Avoid use scoped block variable

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Avoid use scoped block variable
Date: 2025-12-09 16:06:35
Message-ID: CAEudQArS2PHeZGNHqsHVeGhSPZtqdmjDfZu1ta4=4jib8mYknw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

I noticed a possible violation of C rules.
Some functions rely on local block variables,
but this are a mistake.
Once that block exits, the memory of the variable is released.

Fix by moving the declaration variables.

best regards,
Ranier Vilela

Attachment Content-Type Size
avoid-use-scoped-block-variable-lockfuncs.patch application/octet-stream 571 bytes
avoid-use-scoped-block-variable-rawpage.patch application/octet-stream 678 bytes
avoid-use-scoped-block-variable-walsender.patch application/octet-stream 859 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-12-09 16:19:06 Re: Avoid use scoped block variable
Previous Message Сергей Соловьев 2025-12-09 15:31:07 Re: Introduce Index Aggregate - new GROUP BY strategy