Fix calloc check if oom (PQcancelCreate)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Fix calloc check if oom (PQcancelCreate)
Date: 2024-05-27 12:25:45
Message-ID: CAEudQAqQFTH7xCB-+K6zEKjfqbhqCxcr_w4DuJTxVT6h3vzu2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

I think that commit 61461a3
<https://github.com/postgres/postgres/commit/61461a300c1cb5d53955ecd792ad0ce75a104736>,
left some oversight.
The function *PQcancelCreate* fails in check,
return of *calloc* function.

Trivial fix is attached.

But, IMO, I think that has more problems.
If any allocation fails, all allocations must be cleared.
Or is the current behavior acceptable?

best regards,
Ranier Vilela

Attachment Content-Type Size
fix-calloc-check-oom-PQcancelCreate.patch application/octet-stream 432 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2024-05-27 12:41:25 Re: POC: GROUP BY optimization
Previous Message Jelte Fennema-Nio 2024-05-27 06:47:51 Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures