]> 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:30 +0000 (09:32 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 6 Jul 2026 00:32:30 +0000 (09:32 +0900)
commit1f8ab91c11ebf3d6521e2c9d67e321b1256f364c
treed2eb53f158abafc43b8dc15440c3003d12d81c40
parenta7f7958ab6bf368236334ce52e45be5e7502d2e7
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