diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2025-05-22 13:52:46 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2025-05-22 13:52:46 -0400 |
commit | 20bae0690322a00402b84119ddf2f959d24a211a (patch) | |
tree | f9403197fe6a340521116dce9999a70e8fd9424c /src/common/saslprep.c | |
parent | 11efaaffac87e7ba4aedbbb612d2eddc37fabfc4 (diff) |
Fix memory leak in XMLSERIALIZE(... INDENT).
xmltotext_with_options sometimes tries to replace the existing
root node of a libxml2 document. In that case xmlDocSetRootElement
will unlink and return the old root node; if we fail to free it,
it's leaked for the remainder of the session. The amount of memory
at stake is not large, a couple hundred bytes per occurrence, but
that could still become annoying in heavy usage.
Our only other xmlDocSetRootElement call is not at risk because
it's working on a just-created document, but let's modify that
code too to make it clear that it's dependent on that.
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Jim Jones <jim.jones@uni-muenster.de>
Discussion: https://postgr.es/m/1358967.1747858817@sss.pgh.pa.us
Backpatch-through: 16
Diffstat (limited to 'src/common/saslprep.c')
0 files changed, 0 insertions, 0 deletions