diff options
Diffstat (limited to 'src/utils/xml_libxml2.c')
-rw-r--r-- | src/utils/xml_libxml2.c | 2 |
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, '>'); |