diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c index d3ac76b9ef5..c15a5bb6225 100644 --- a/contrib/xml2/xpath.c +++ b/contrib/xml2/xpath.c @@ -582,7 +582,10 @@ pgxml_result_to_text(xmlXPathObjectPtr res, text *xpres; if (res == NULL) + { + xmlCleanupParser(); return NULL; + } switch (res->type) { case XPATH_NODESET: