]> git.ipfire.org Git - thirdparty/postgresql.git/commit
amcheck: Fix memory leak with gin_index_check()
authorMichael Paquier <michael@paquier.xyz>
Mon, 6 Jul 2026 00:32:28 +0000 (09:32 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 6 Jul 2026 00:32:28 +0000 (09:32 +0900)
commit80cfd8aef645295aceafd2aa98912c64edd06394
tree42663a23eeea2851f6900eddde753b214ab747a9
parent56e892a49439ad361d8610bd859f4c7a29ec336e
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
contrib/amcheck/verify_gin.c