[libvirt] VMware ESX: Fix memory leaks in esxDomainDumpXML()

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

 



Subject says it all.
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 11b727b..d460f76 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -2023,10 +2023,13 @@ esxDomainDumpXML(virDomainPtr domain, int flags)
     }
 
   cleanup:
+    esxVI_String_Free(&propertyNameList);
+    esxVI_ObjectContent_Free(&virtualMachine);
     VIR_FREE(datastoreName);
     VIR_FREE(vmxPath);
     VIR_FREE(url);
     VIR_FREE(vmx);
+    virDomainDefFree(def);
 
     return xml;
 
@@ -2049,7 +2052,7 @@ esxDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat,
     if (STRNEQ(nativeFormat, "vmware-vmx")) {
         ESX_ERROR(conn, VIR_ERR_INVALID_ARG,
                   "Unsupported config format '%s'", nativeFormat);
-        goto cleanup;
+        return NULL;
     }
 
     def = esxVMX_ParseConfig(conn, nativeConfig);
@@ -2058,7 +2061,6 @@ esxDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat,
         xml = virDomainDefFormat(conn, def, VIR_DOMAIN_XML_INACTIVE);
     }
 
-cleanup:
     virDomainDefFree(def);
 
     return xml;
--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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]