From 91a60a560fea10e1693b49125180b60405ee9ad8 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Wed, 27 Aug 2014 15:40:57 -0400 Subject: [PATCH] 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. --- src/conf/storage_conf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 5a16767f16..e72a869cba 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; } -- 2.47.2