summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ferlan <jferlan@redhat.com>2014-08-27 15:40:57 -0400
committerJohn Ferlan <jferlan@redhat.com>2014-08-28 08:12:17 -0400
commit91a60a560fea10e1693b49125180b60405ee9ad8 (patch)
tree209aec5b2e7aa2351c429f377cd24a622824737e
parent69e433bc22a3d713af379ce5a787e470d67db6e8 (diff)
downloadlibvirt-91a60a560fea10e1693b49125180b60405ee9ad8.tar.gz
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.
-rw-r--r--src/conf/storage_conf.c2
1 files changed, 2 insertions, 0 deletions
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;
}