diff --git a/tree.c b/tree.c index c1452a48..eae778d6 100644 --- a/tree.c +++ b/tree.c @@ -4090,6 +4090,10 @@ xmlCopyNamespaceList(xmlNsPtr cur) { while (cur != NULL) { q = xmlCopyNamespace(cur); + if (q == NULL) { + xmlFreeNsList(ret); + return(NULL); + } if (p == NULL) { ret = p = q; } else {