It turns out the LIBXML_TEST_VERSION macro calls xmlInitParser().
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 12 Jan 2008 21:14:08 +0000 (21:14 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 12 Jan 2008 21:14:08 +0000 (21:14 +0000)
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

index 9eea2b62301863e2539b05f845953f168f6ca020..7c63d0346cf6cf6e42ef160e791a5c104c0662cc 100644 (file)
@@ -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