postgresql/contrib/xml2
Tom Lane 6a694bbab2 Free libxml2/libxslt resources in a safer order.
Mark Simonetti reported that libxslt sometimes crashes for him, and that
swapping xslt_process's object-freeing calls around to do them in reverse
order of creation seemed to fix it.  I've not reproduced the crash, but
valgrind clearly shows a reference to already-freed memory, which is
consistent with the idea that shutdown of the xsltTransformContext is
trying to reference the already-freed stylesheet or input document.
With this patch, valgrind is no longer unhappy.

I have an inquiry in to see if this is a libxslt bug or if we're just
abusing the library; but even if it's a library bug, we'd want to adjust
our code so it doesn't fail with unpatched libraries.

Back-patch to all supported branches, because we've been doing this in
the wrong(?) order for a long time.
2014-11-27 11:13:03 -05:00
..
expected Prevent access to external files/URLs via contrib/xml2's xslt_process(). 2012-08-14 18:32:21 -04:00
sql Prevent access to external files/URLs via contrib/xml2's xslt_process(). 2012-08-14 18:32:21 -04:00
.gitignore Add contrib/xml2/pgxml.sql to .gitignore 2010-09-23 22:08:25 -04:00
Makefile Fix contrib/xml2 so regression test still works when it's built without libxslt. 2010-03-01 18:07:59 +00:00
pgxml.sql.in Fix contrib/xml2 so regression test still works when it's built without libxslt. 2010-03-01 18:07:59 +00:00
uninstall_pgxml.sql Add CVS version labels to all install/uninstall scripts. 2007-11-13 04:24:29 +00:00
xpath.c Fix significant memory leak in contrib/xml2 functions. 2010-11-26 15:20:55 -05:00
xslt_proc.c Free libxml2/libxslt resources in a safer order. 2014-11-27 11:13:03 -05:00