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:
parent
69e433bc22
commit
91a60a560f
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user