Cleanup palloc'd structs on soft error path in `record_in`

From: Kirill Reshke <reshkekirill(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Cleanup palloc'd structs on soft error path in `record_in`
Date: 2026-01-17 10:57:30
Message-ID: CALdSSPjaY86HX+MWOT28F05gE46AqeYFvAdp8qJgWQcPJ=gOHw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers!

I have been looking in coverity that runs against our PostgreSQL
fork(vanilla + our poor-man patches to be more cloud-native), and
spotted $subj.

Unlike many other reports, this looks like a real one to me?

Looks like after ccff2d20ed96, when we changed elog to ereport in a
number of places in this function, we now fail to release memory
allocated for one row. Now, PostgreSQL has REJECT_LIMIT feature, so
looks like this leak can aggregate in COPY scenarios

WDYT?

PFA trivial fix.

--
Best regards,
Kirill Reshke

Attachment Content-Type Size
v1-0001-Cleanup-palloc-d-strucrs-on-sotf-error-path-in-re.patch application/octet-stream 1.2 KB

Browse pgsql-hackers by date

  From Date Subject
Previous Message Pavel Stehule 2026-01-17 10:22:04 Re: jsonb subscripting vs SQL/JSON array accessor semantics (SQL:2023)