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

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



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;

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