mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
netdev_vlan_conf: Resolve memory leak found by Valgrind.
The 'trunk' is filled in with virXPathString() value, but was never VIR_FREE()'d.
This commit is contained in:
parent
785d6bc58a
commit
ba9c7a3026
@ -32,7 +32,7 @@ virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr de
|
||||
{
|
||||
int ret = -1;
|
||||
xmlNodePtr save = ctxt->node;
|
||||
const char *trunk;
|
||||
const char *trunk = NULL;
|
||||
xmlNodePtr *tagNodes = NULL;
|
||||
int nTags, ii;
|
||||
|
||||
@ -103,6 +103,7 @@ virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr de
|
||||
error:
|
||||
ctxt->node = save;
|
||||
VIR_FREE(tagNodes);
|
||||
VIR_FREE(trunk);
|
||||
if (ret < 0)
|
||||
virNetDevVlanClear(def);
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user