Re: pg_parse_json() should not leak token copies on failure - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_parse_json() should not leak token copies on failure
Date
Msg-id Zl_0aJcs1MVwx60v@paquier.xyz
Whole thread Raw
In response to Re: pg_parse_json() should not leak token copies on failure  (Jacob Champion <jacob.champion@enterprisedb.com>)
List pgsql-hackers
On Tue, Jun 04, 2024 at 10:10:06AM -0700, Jacob Champion wrote:
> On Mon, Jun 3, 2024 at 9:32 PM Kyotaro Horiguchi
> <horikyota.ntt@gmail.com> wrote:
>> I understand that the part enclosed in parentheses refers to the "if
>> (ptr) pfree(ptr)" structure. I believe we rely on the behavior of
>> free(NULL), which safely does nothing. (I couldn't find the related
>> discussion due to a timeout error on the ML search page.)
>
> For the frontend, right. For the backend, pfree(NULL) causes a crash.
> I think [1] is a related discussion on the list, maybe the one you
> were looking for?

FYI, these choices relate also to 805a397db40b, e890ce7a4feb and
098c703d308f.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Infinite loop in XLogPageRead() on standby
Next
From: Alexander Pyhalov
Date:
Subject: Re: Partial aggregates pushdown