util: xml: Introduce VIR_AUTOPTR functions for xmlDoc and xmlXPathContext

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>
This commit is contained in:
Peter Krempa 2019-03-08 16:02:27 +01:00
parent afbf71af24
commit 0973dbd841

View 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 */