mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +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:
parent
69e433bc22
commit
91a60a560f
@ -661,6 +661,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
|
||||
}
|
||||
|
||||
source->auth = authdef;
|
||||
authdef = NULL;
|
||||
}
|
||||
|
||||
source->vendor = virXPathString("string(./vendor/@name)", ctxt);
|
||||
@ -673,6 +674,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
|
||||
VIR_FREE(port);
|
||||
VIR_FREE(nodeset);
|
||||
VIR_FREE(adapter_type);
|
||||
virStorageAuthDefFree(authdef);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user