]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: xml: Introduce VIR_AUTOPTR functions for xmlDoc and xmlXPathContext
authorPeter Krempa <pkrempa@redhat.com>
Fri, 8 Mar 2019 15:02:27 +0000 (16:02 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 20 Mar 2019 07:17:05 +0000 (08:17 +0100)
We can use our VIR_AUTOPTR machinery also for libxml2's xmlDoc and
xmlXPathContext.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virxml.h

index b91fedde82a5f9d0a6a75ed339787de0628767a0..4875e88f2e6a0aa47542d19f8fd12b9ea1055833 100644 (file)
@@ -244,4 +244,7 @@ VIR_DEFINE_AUTOCLEAN_FUNC(virXPathContextNodeSave, virXPathContextNodeRestore);
                                                                  .node = _ctxt->node}; \
     ignore_value(&_ctxt ## CtxtSave)
 
+VIR_DEFINE_AUTOPTR_FUNC(xmlDoc, xmlFreeDoc);
+VIR_DEFINE_AUTOPTR_FUNC(xmlXPathContext, xmlXPathFreeContext);
+
 #endif /* LIBVIRT_VIRXML_H */