> On Jan 19, 2026, at 14:11, Michael Paquier <[email protected]> wrote:
> 
>> vatuples[I] is returned by SearchSysCacheCopy1(), I believe it
>> should be free by heap_freetuple(). See the header comment of
>> SearchSysCacheCopy().
> 
> Here I believe that the issue is different: vatuples is not needed at
> all, and can be removed.  We use it nowhere in when importing a MCV
> list.

Hi Michael,

May I ask an off-list question?

Should tuples returned by SearchSysCacheCopy1() always be explicitly freed with 
heap_freetuple()? I’ve long had the understanding that the answer is “yes”.

However, recently I’ve seen some patches addressing apparent memory leaks 
deemed unnecessary on the grounds that the surrounding memory context would 
clean things up anyway. That made me unsure whether the same reasoning is 
considered acceptable for tuples returned by SearchSysCacheCopy1(), or whether 
the expectation is still that callers should free them explicitly.

I’d appreciate any clarification on the question. Thanks in advance.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/






Reply via email to