]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
esx: Fix memory leak
authorWang King <king.wang@huawei.com>
Wed, 12 Apr 2017 10:06:44 +0000 (18:06 +0800)
committerCole Robinson <crobinso@redhat.com>
Wed, 10 May 2017 19:33:55 +0000 (15:33 -0400)
Variable def going out of scope leaks the storage def.source.hosts points to.

(cherry picked from commit d76267b2e4fb7a2388625b7cd4037d7b69db23d9)

src/esx/esx_storage_backend_vmfs.c

index a1a660bfec7c0963d84726237b33b32f968aa59b..940e5d1f0685d770213f98b91f030a19b5328779 100644 (file)
@@ -513,6 +513,7 @@ esxStoragePoolGetXMLDesc(virStoragePoolPtr pool, unsigned int flags)
     xml = virStoragePoolDefFormat(&def);
 
  cleanup:
+    VIR_FREE(def.source.hosts);
     esxVI_String_Free(&propertyNameList);
     esxVI_ObjectContent_Free(&datastore);
     esxVI_DatastoreHostMount_Free(&hostMount);