pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix low-probability memory leak in XMLSERIALIZE(... INDENT).
Date: Tue, 08 Jul 2025 16:50:47 +0000
Message-ID: <E1uZBWp-005Hyn-0g@gemulon.postgresql.org> (raw)

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(-)



view thread (11+ messages)  latest in thread

Message-ID: <E1uZBWp-005Hyn-0g@gemulon.postgresql.org>
Permalink:  ../E1uZBWp-005Hyn-0g@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uZBWp-005Hyn-0g@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix low-probability memory leak in XMLSERIALIZE(... INDENT).
  In-Reply-To: <E1uZBWp-005Hyn-0g@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox