]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix low-probability memory leak in XMLSERIALIZE(... INDENT).
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Jul 2025 16:50:19 +0000 (12:50 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Jul 2025 16:50:19 +0000 (12:50 -0400)
commit075554ec6c0c8ef9fca38086624d27d8df2a27d7
tree3d014e8d55fbd5c23d4abbc62d5a89f6e01cf46a
parent330db576f8c37479d472c3e9b0eb6d47ba1d97f4
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
src/backend/utils/adt/xml.c