From: | tgl(at)postgresql(dot)org (Tom Lane) |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix intratransaction memory leaks in xml_recv, xmlconcat, |
Date: | 2009-05-12 20:17:46 |
Message-ID: | 20090512201746.B215975407D@cvs.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Log Message:
-----------
Fix intratransaction memory leaks in xml_recv, xmlconcat, xmlroot, and
xml_parse, all arising from the same sloppy usage of parse_xml_decl.
The original coding had that function returning its output string
parameters in the libxml context, which is long-lived, and all but one
of its callers neglected to free the strings afterwards. The easiest
and most bulletproof fix is to return the strings in the local palloc
context instead, since that's short-lived. This was only costing a
dozen or two bytes per function call, but that adds up fast if the
function is called repeatedly ...
Noted while poking at the more general problem of what to do with our
libxml memory allocation hooks. Back-patch to 8.3, which has the
identical coding.
Tags:
----
REL8_3_STABLE
Modified Files:
--------------
pgsql/src/backend/utils/adt:
xml.c (r1.68.2.7 -> r1.68.2.8)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/xml.c?r1=1.68.2.7&r2=1.68.2.8)
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2009-05-12 20:50:38 | Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it |
Previous Message | Tom Lane | 2009-05-12 20:17:40 | pgsql: Fix intratransaction memory leaks in xml_recv, xmlconcat, |