pgsql: Fix low-probability memory leak in XMLSERIALIZE(... INDENT). - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix low-probability memory leak in XMLSERIALIZE(... INDENT).
Date
Msg-id E1uZBWp-005Hyn-0g@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix low-probability memory leak in XMLSERIALIZE(... INDENT).

xmltotext_with_options() did not consider the possibility that
pg_xml_init() could fail --- most likely due to OOM.  If that
happened, the already-parsed xmlDoc structure would be leaked.
Oversight in commit 483bdb2af.

Bug: #18981
Author: Dmitry Kovalenko <d.kovalenko@postgrespro.ru>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/18981-9bc3c80f107ae925@postgresql.org
Backpatch-through: 16

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/95cf1a1817c992769e38cda7437751af54642ef8

Modified Files
--------------
src/backend/utils/adt/xml.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: pg_walsummary: Improve stability of test checking statistics
Next
From: Tom Lane
Date:
Subject: pgsql: Fix up misuse of "volatile" in contrib/xml2.