From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> |
Cc: | Peter Smith <smithpb2250(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andrey Borodin <amborodin86(at)gmail(dot)com> |
Subject: | Re: [PATCH] Add pretty-printed XML output option |
Date: | 2025-05-21 23:48:05 |
Message-ID: | 1418827.1747871285@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> writes:
> On 21.05.25 22:20, Tom Lane wrote:
>> It turns out that xmlDocSetRootElement() doesn't
>> merely install the given root node: it unlinks the document's old
>> root node and returns it to you. If you don't free it, it's leaked
>> (for the session, since this is a malloc not palloc).
> The xmlsoft examples are a bit misleading though [1]
Yeah. I also did some searching on http://codesearch.debian.net
and was hard put to it to find anything that pays attention to
xmlDocSetRootElement's result at all. I wonder how many of those
represent leaks.
> It seems that xml_parse has the same issue[3]
I did look at that one too. I think it's fine, because we're
dealing with a newly-created document which can't have a root node
yet. (Reinforcing this, Valgrind sees no leaks after applying
my patch.) I considered adding an assertion that that call returns
NULL, but concluded that it wasn't worth the notational hassle.
I'm not strongly set on that conclusion, though, if you think
differently.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2025-05-21 23:50:04 | Re: Addition of %b/backend_type in log_line_prefix of TAP test logs |
Previous Message | Michael Paquier | 2025-05-21 23:17:33 | Re: Persist injection points across server restarts |