提交 91a60a56 编写于 作者: J John Ferlan

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.
上级 69e433bc
...@@ -661,6 +661,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, ...@@ -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, ...@@ -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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册