summaryrefslogtreecommitdiff
path: root/src/utils/xml_libxml2.c
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2017-10-18 03:44:27 +0000
committerCy Schubert <cy@FreeBSD.org>2017-10-18 03:44:27 +0000
commit256810032c472505440606bd9c1c4f7dbf06b0a2 (patch)
treed019f4f1ae29b86cbd3e9e74f832689976a267cf /src/utils/xml_libxml2.c
parentb834757ea3bcd1bba3381ff7cab216458d8f7efb (diff)
Notes
Diffstat (limited to 'src/utils/xml_libxml2.c')
-rw-r--r--src/utils/xml_libxml2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils/xml_libxml2.c b/src/utils/xml_libxml2.c
index c92839461dad..7b6d2764b0ed 100644
--- a/src/utils/xml_libxml2.c
+++ b/src/utils/xml_libxml2.c
@@ -212,6 +212,8 @@ char * xml_node_to_str(struct xml_node_ctx *ctx, xml_node_t *node)
xmlDocSetRootElement(doc, n);
xmlDocDumpFormatMemory(doc, &buf, &bufsiz, 0);
xmlFreeDoc(doc);
+ if (!buf)
+ return NULL;
pos = (char *) buf;
if (strncmp(pos, "<?xml", 5) == 0) {
pos = strchr(pos, '>');