Re: Fix memory leak in gist_page_items() of pageinspect - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Fix memory leak in gist_page_items() of pageinspect
Date
Msg-id aUKamYGiDKO6byp5@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Fix memory leak in gist_page_items() of pageinspect  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Hi,

On Mon, Dec 15, 2025 at 01:08:44PM +0900, Michael Paquier wrote:
> While passing through, I have applied 0001.

Out of curiosity, I searched for other mismatched index_open/relation_close pairs
in the tree and found a few more with the help of [1].

They are fixed in the attached.

Please note that for hash_bitmap_info() and pgstathashindex() the open calls are
changed instead. For those we keep the IS_INDEX() checks to reject partitioned
indexes (which index_open() accepts via validate_relation_kind()). So, that also
changes the error messages in some tests. If we do prefer the previous error
messages we could change the close calls instead (I prefer the way it's done
in the attached though).

Thoughts?

[1]: https://github.com/bdrouvot/coccinelle_on_pg/blob/main/misc/mismatched_open_close_pairs.cocci

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment

pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: pgsql: Revert "Avoid requiring Spanish locale to test NLS infrastructur
Next
From: Amit Kapila
Date:
Subject: Re: DOCS - Clarify the publication 'publish_via_partition_root' default value.