From: John Ferlan Date: Wed, 27 Aug 2014 19:40:57 +0000 (-0400) Subject: storage_conf: Resolve Coverity RESOURCE_LEAK X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=91a60a560fea10e1693b49125180b60405ee9ad8;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git 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. --- diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 5a16767f1..e72a869cb 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -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; }