Cleanup palloc'd structs on soft error path in `record_in` - Mailing list pgsql-hackers

From Kirill Reshke
Subject Cleanup palloc'd structs on soft error path in `record_in`
Date
Msg-id CALdSSPjaY86HX+MWOT28F05gE46AqeYFvAdp8qJgWQcPJ=gOHw@mail.gmail.com
Whole thread Raw
List 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

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: jsonb subscripting vs SQL/JSON array accessor semantics (SQL:2023)
Next
From: Kirill Reshke
Date:
Subject: Re: Parallel CREATE INDEX for GIN indexes