mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
Fix memory leak in virsh snapshot-list.
We were forgetting to release the memory allocated by virDomainSnapshotListNames. Free the memory properly. Signed-off-by: Chris Lalancette <clalance@redhat.com>
This commit is contained in:
parent
21c6cfc213
commit
52ae076a94
@ -8360,7 +8360,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
|
||||
int ret = FALSE;
|
||||
int numsnaps;
|
||||
char **names = NULL;
|
||||
int actual;
|
||||
int actual = 0;
|
||||
int i;
|
||||
xmlDocPtr xml = NULL;
|
||||
xmlXPathContextPtr ctxt = NULL;
|
||||
@ -8447,6 +8447,8 @@ cleanup:
|
||||
if (xml)
|
||||
xmlFreeDoc(xml);
|
||||
VIR_FREE(doc);
|
||||
for (i = 0; i < actual; i++)
|
||||
VIR_FREE(names[i]);
|
||||
VIR_FREE(names);
|
||||
if (dom)
|
||||
virDomainFree(dom);
|
||||
|
Loading…
x
Reference in New Issue
Block a user