mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tools: virsh: use automatic cleanup for xmlXPathObject
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
@@ -527,7 +527,7 @@ virshMakeCloneXML(const char *origxml, const char *newname)
|
||||
{
|
||||
xmlDocPtr doc = NULL;
|
||||
g_autoptr(xmlXPathContext) ctxt = NULL;
|
||||
xmlXPathObjectPtr obj = NULL;
|
||||
g_autoptr(xmlXPathObject) obj = NULL;
|
||||
xmlChar *newxml = NULL;
|
||||
int size;
|
||||
|
||||
@@ -544,7 +544,6 @@ virshMakeCloneXML(const char *origxml, const char *newname)
|
||||
xmlDocDumpMemory(doc, &newxml, &size);
|
||||
|
||||
cleanup:
|
||||
xmlXPathFreeObject(obj);
|
||||
xmlFreeDoc(doc);
|
||||
return newxml;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user