From 717d80b5e11d0caee1f093760c8e246ba28b57af Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 12 Jan 2008 21:14:08 +0000 Subject: [PATCH] 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. --- src/backend/utils/adt/xml.c | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.5