diff --git a/tree.c b/tree.c index 64572d9f..2130d55d 100644 --- a/tree.c +++ b/tree.c @@ -1649,6 +1649,10 @@ xmlStringGetNodeList(const xmlDoc *doc, const xmlChar *value) { if (!xmlBufIsEmpty(buf)) { node = xmlNewDocText(doc, NULL); + if (node == NULL) { + xmlBufFree(buf); + return(NULL); + } node->content = xmlBufDetach(buf); if (last == NULL) {