Re: Avoid use scoped block variable
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Ranier Vilela <ranier.vf@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2025-12-09T16:19:06Z
Lists: pgsql-hackers
Hi, On 2025-12-09 13:06:35 -0300, Ranier Vilela wrote: > 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. CStringGetTextDatum() copies its input to a fresh allocation. So there's no longer-lived references to the local memory, unless I miss something? Greetings, Andres Freund