diff --git a/tree.c b/tree.c index d2347dfdf..636f81fed 100644 --- a/tree.c +++ b/tree.c @@ -4881,7 +4881,9 @@ xmlGetNodePath(const xmlNode *node) } next = ((xmlAttrPtr) cur)->parent; } else { - next = cur->parent; + xmlFree(buf); + xmlFree(buffer); + return (NULL); } /*