]> 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)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 13 Apr 2017 12:14:54 +0000 (08:14 -0400)
Variable def going out of scope leaks the storage def.source.hosts points to.

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);