agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: amcheck: Fix memory leak with gin_index_check()
Date: Mon, 06 Jul 2026 00:32:46 +0000
Message-ID: <E1wgXGR-001Vjk-0D@gemulon.postgresql.org> (raw)

amcheck: Fix memory leak with gin_index_check()

"prev_tuple" was overwritten with a new tuple coming from
CopyIndexTuple() on each loop, leaking memory for every tuple processed
on entry tree pages.  The function uses a dedicated memory context, but
this could leave unused large areas of memory while processing a large
GIN index, the larger the worse.

Oversight in 14ffaece0fb5.

Author: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Ewan Young <kdbase.hack@gmail.com>
Discussion: https://postgr.es/m/CALdSSPjTS6TYe5=5NfMUBYZyQu5cn=ABL6K5_OZjzGWqnwXeBw@mail.gmail.com
Backpatch-through: 18

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/80cfd8aef645295aceafd2aa98912c64edd06394

Modified Files
--------------
contrib/amcheck/verify_gin.c | 3 +++
1 file changed, 3 insertions(+)



view thread (3+ messages)  latest in thread

Message-ID: <E1wgXGR-001Vjk-0D@gemulon.postgresql.org>
Permalink:  ../E1wgXGR-001Vjk-0D@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wgXGR-001Vjk-0D@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: amcheck: Fix memory leak with gin_index_check()
  In-Reply-To: <E1wgXGR-001Vjk-0D@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox