esx: Fix memory leak

Variable def going out of scope leaks the storage def.source.hosts points to.

(cherry picked from commit d76267b2e4fb7a2388625b7cd4037d7b69db23d9)
This commit is contained in:
Wang King 2017-04-12 18:06:44 +08:00 committed by Cole Robinson
parent e0af3fd525
commit 3e79094909

View File

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