mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
maint: treat more libxml2 functions as free-like
* cfg.mk (useless_free_options): Add xmlFreeDoc, xmlBufferFree. * src/esx/esx_vi.c (ESX_VI__TEMPLATE__FREE): Fix offenders. * tools/virsh.c (cmdFreecell, cmdVNCDisplay, cmdTTYConsole) (cmdDetachInterface, cmdDetachDisk, cmdSnapshotCreate) (cmdSnapshotCreateAs, cmdSnapshotList, cmdSnapshotParent): Likewise.
This commit is contained in:
parent
5f98c43707
commit
e472fe25c7
2
cfg.mk
2
cfg.mk
@ -165,7 +165,9 @@ useless_free_options = \
|
||||
--name=virStoragePoolSourceFree \
|
||||
--name=virStorageVolDefFree \
|
||||
--name=virThreadPoolFree \
|
||||
--name=xmlBufferFree \
|
||||
--name=xmlFree \
|
||||
--name=xmlFreeDoc \
|
||||
--name=xmlXPathFreeContext \
|
||||
--name=xmlXPathFreeObject
|
||||
|
||||
|
@ -1074,9 +1074,7 @@ ESX_VI__TEMPLATE__FREE(Response,
|
||||
{
|
||||
VIR_FREE(item->content);
|
||||
|
||||
if (item->document != NULL) {
|
||||
xmlFreeDoc(item->document);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
@ -2971,7 +2971,6 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd)
|
||||
|
||||
cleanup:
|
||||
xmlXPathFreeContext(ctxt);
|
||||
if (xml)
|
||||
xmlFreeDoc(xml);
|
||||
VIR_FREE(nodes);
|
||||
VIR_FREE(nodes_free);
|
||||
@ -10234,7 +10233,6 @@ cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd)
|
||||
cleanup:
|
||||
xmlXPathFreeObject(obj);
|
||||
xmlXPathFreeContext(ctxt);
|
||||
if (xml)
|
||||
xmlFreeDoc(xml);
|
||||
virDomainFree(dom);
|
||||
return ret;
|
||||
@ -10295,7 +10293,6 @@ cmdTTYConsole(vshControl *ctl, const vshCmd *cmd)
|
||||
cleanup:
|
||||
xmlXPathFreeObject(obj);
|
||||
xmlXPathFreeContext(ctxt);
|
||||
if (xml)
|
||||
xmlFreeDoc(xml);
|
||||
virDomainFree(dom);
|
||||
return ret;
|
||||
@ -10752,9 +10749,7 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
|
||||
virDomainFree(dom);
|
||||
xmlXPathFreeObject(obj);
|
||||
xmlXPathFreeContext(ctxt);
|
||||
if (xml)
|
||||
xmlFreeDoc(xml);
|
||||
if (xml_buf)
|
||||
xmlBufferFree(xml_buf);
|
||||
return functionReturn;
|
||||
}
|
||||
@ -11216,9 +11211,7 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd)
|
||||
cleanup:
|
||||
xmlXPathFreeObject(obj);
|
||||
xmlXPathFreeContext(ctxt);
|
||||
if (xml)
|
||||
xmlFreeDoc(xml);
|
||||
if (xml_buf)
|
||||
xmlBufferFree(xml_buf);
|
||||
if (dom)
|
||||
virDomainFree(dom);
|
||||
@ -11898,7 +11891,6 @@ cmdSnapshotCreate(vshControl *ctl, const vshCmd *cmd)
|
||||
cleanup:
|
||||
VIR_FREE(name);
|
||||
xmlXPathFreeContext(ctxt);
|
||||
if (xml)
|
||||
xmlFreeDoc(xml);
|
||||
if (snapshot)
|
||||
virDomainSnapshotFree(snapshot);
|
||||
@ -12005,7 +11997,6 @@ cmdSnapshotCreateAs(vshControl *ctl, const vshCmd *cmd)
|
||||
cleanup:
|
||||
VIR_FREE(parsed_name);
|
||||
xmlXPathFreeContext(ctxt);
|
||||
if (xml)
|
||||
xmlFreeDoc(xml);
|
||||
if (snapshot)
|
||||
virDomainSnapshotFree(snapshot);
|
||||
@ -12163,7 +12154,6 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
|
||||
if (snapshot)
|
||||
virDomainSnapshotFree(snapshot);
|
||||
xmlXPathFreeContext(ctxt);
|
||||
if (xml)
|
||||
xmlFreeDoc(xml);
|
||||
VIR_FREE(doc);
|
||||
|
||||
@ -12210,7 +12200,6 @@ cleanup:
|
||||
if (snapshot)
|
||||
virDomainSnapshotFree(snapshot);
|
||||
xmlXPathFreeContext(ctxt);
|
||||
if (xml)
|
||||
xmlFreeDoc(xml);
|
||||
VIR_FREE(doc);
|
||||
for (i = 0; i < actual; i++)
|
||||
@ -12343,7 +12332,6 @@ cmdSnapshotParent(vshControl *ctl, const vshCmd *cmd)
|
||||
cleanup:
|
||||
VIR_FREE(parent);
|
||||
xmlXPathFreeContext(ctxt);
|
||||
if (xmldoc)
|
||||
xmlFreeDoc(xmldoc);
|
||||
VIR_FREE(xml);
|
||||
if (snapshot)
|
||||
|
Loading…
x
Reference in New Issue
Block a user