*** pgxml_dom.c Wed Mar 6 01:09:13 2002 --- pgxml_dom.new Thu Nov 28 12:28:08 2002 *************** *** 87,96 **** doctree = xmlParseMemory((char *) VARDATA(t), docsize); if (doctree == NULL) { ! /* xmlCleanupParser(); */ PG_RETURN_BOOL(false); /* i.e. not well-formed */ } ! /* xmlCleanupParser(); */ xmlFreeDoc(doctree); PG_RETURN_BOOL(true); } --- 87,96 ---- doctree = xmlParseMemory((char *) VARDATA(t), docsize); if (doctree == NULL) { ! xmlCleanupParser(); PG_RETURN_BOOL(false); /* i.e. not well-formed */ } ! xmlCleanupParser(); xmlFreeDoc(doctree); PG_RETURN_BOOL(true); } *************** *** 202,208 **** doctree = xmlParseMemory((char *) VARDATA(t), docsize); if (doctree == NULL) ! { /* not well-formed */ PG_RETURN_NULL(); } --- 202,209 ---- doctree = xmlParseMemory((char *) VARDATA(t), docsize); if (doctree == NULL) ! { /* not well-formed */ ! xmlCleanupParser(); PG_RETURN_NULL(); } *************** *** 216,221 **** --- 217,223 ---- elog(WARNING, "XPath syntax error"); xmlFreeDoc(doctree); pfree((void *) xpath); + xmlCleanupParser(); PG_RETURN_NULL(); } *************** *** 227,232 **** --- 229,235 ---- { xmlFreeDoc(doctree); pfree((void *) xpath); + xmlCleanupParser(); PG_RETURN_NULL(); /* seems appropriate */ } /* now we dump this node, ?surrounding by tags? */ *************** *** 257,262 **** xmlFreeDoc(doctree); pfree((void *) xpath); xmlFree(xpresstr); ! PG_RETURN_TEXT_P(xpres); } --- 260,265 ---- xmlFreeDoc(doctree); pfree((void *) xpath); xmlFree(xpresstr); ! xmlCleanupParser(); PG_RETURN_TEXT_P(xpres); }