1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

conf: Resolve Coverity RESOURCE_LEAK

Commit id 'c9027d8f' added parsing of the CapNet for offload SRIOV NIC
discovery, but forgot to free the nodes
This commit is contained in:
John Ferlan 2015-03-10 18:24:49 -04:00
parent 1cfc0a9990
commit d9beeb68e4

View File

@ -939,7 +939,7 @@ virNodeDevCapNetParseXML(xmlXPathContextPtr ctxt,
xmlNodePtr orignode, lnk; xmlNodePtr orignode, lnk;
size_t i = -1; size_t i = -1;
int ret = -1, n = -1; int ret = -1, n = -1;
char *tmp; char *tmp = NULL;
xmlNodePtr *nodes = NULL; xmlNodePtr *nodes = NULL;
orignode = ctxt->node; orignode = ctxt->node;
@ -978,6 +978,7 @@ virNodeDevCapNetParseXML(xmlXPathContextPtr ctxt,
goto out; goto out;
} }
ignore_value(virBitmapSetBit(data->net.features, val)); ignore_value(virBitmapSetBit(data->net.features, val));
VIR_FREE(tmp);
} }
data->net.subtype = VIR_NODE_DEV_CAP_NET_LAST; data->net.subtype = VIR_NODE_DEV_CAP_NET_LAST;
@ -1002,6 +1003,8 @@ virNodeDevCapNetParseXML(xmlXPathContextPtr ctxt,
ret = 0; ret = 0;
out: out:
ctxt->node = orignode; ctxt->node = orignode;
VIR_FREE(nodes);
VIR_FREE(tmp);
return ret; return ret;
} }