Re: pg_parse_json() should not leak token copies on failure

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_parse_json() should not leak token copies on failure
Date: 2024-06-05 05:15:20
Message-ID: Zl_0aJcs1MVwx60v@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)ntt(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Pyhalov 2024-06-05 05:19:04 Re: Partial aggregates pushdown
Previous Message Michael Paquier 2024-06-05 05:09:01 Re: Infinite loop in XLogPageRead() on standby