[libvirt] [PATCH 15/34] util: xml: Introduce VIR_AUTOPTR functions for xmlDoc and xmlXPathContext
Peter Krempa
pkrempa at redhat.com
Mon Mar 18 15:55:04 UTC 2019
We can use our VIR_AUTOPTR machinery also for libxml2's xmlDoc and
xmlXPathContext.
Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
src/util/virxml.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/util/virxml.h b/src/util/virxml.h
index b91fedde82..4875e88f2e 100644
--- a/src/util/virxml.h
+++ b/src/util/virxml.h
@@ -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 */
--
2.20.1
More information about the libvir-list
mailing list