From: Tom Lane Date: Sat, 12 Jan 2008 21:14:08 +0000 (+0000) Subject: It turns out the LIBXML_TEST_VERSION macro calls xmlInitParser(). X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=717d80b5e11d0caee1f093760c8e246ba28b57af;p=users%2Fbernd%2Fpostgres.git It turns out the LIBXML_TEST_VERSION macro calls xmlInitParser(). Therefore we must xmlCleanupParser(), or we risk leaving behind dangling pointers to whatever memory context is current when xml_init() is called. This seems to fix bug #3860, though we might still want the more invasive solution being worked on by Alvaro. --- diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 9eea2b6230..7c63d0346c 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -958,6 +958,9 @@ xml_init(void) /* Check library compatibility */ LIBXML_TEST_VERSION; + /* The above calls xmlInitParser(); must clean up dangling pointers */ + xmlCleanupParser(); + first_time = false; } else