1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

storage_conf: Resolve Coverity RESOURCE_LEAK

If there was a failure processing 'authdef' and the code went to cleanup
before the setting to source->auth, then it'd be leaked.
This commit is contained in:
John Ferlan 2014-08-27 15:40:57 -04:00
parent 69e433bc22
commit 91a60a560f

View File

@ -661,6 +661,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
} }
source->auth = authdef; source->auth = authdef;
authdef = NULL;
} }
source->vendor = virXPathString("string(./vendor/@name)", ctxt); source->vendor = virXPathString("string(./vendor/@name)", ctxt);
@ -673,6 +674,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
VIR_FREE(port); VIR_FREE(port);
VIR_FREE(nodeset); VIR_FREE(nodeset);
VIR_FREE(adapter_type); VIR_FREE(adapter_type);
virStorageAuthDefFree(authdef);
return ret; return ret;
} }