[PATCH 10/23] xenParseXMDisk: Use automatic memory clearing and remove 'ret' variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/libxl/xen_xm.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/libxl/xen_xm.c b/src/libxl/xen_xm.c
index ac86ddf9b7..f978b94f93 100644
--- a/src/libxl/xen_xm.c
+++ b/src/libxl/xen_xm.c
@@ -238,9 +238,9 @@ xenParseXMDisk(char *entry, int hvm)
 static int
 xenParseXMDiskList(virConf *conf, virDomainDef *def)
 {
-    char **disks = NULL, **entries;
+    g_auto(GStrv) disks = NULL;
+    GStrv entries;
     int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM;
-    int ret = -1;
     int rc;

     rc = virConfGetValueStringList(conf, "disk", false, &disks);
@@ -258,10 +258,7 @@ xenParseXMDiskList(virConf *conf, virDomainDef *def)
         VIR_APPEND_ELEMENT(def->disks, def->ndisks, disk);
     }

-    ret = 0;
-
-    g_strfreev(disks);
-    return ret;
+    return 0;
 }


-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux