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 <[email protected]>
Reviewed-by: Ewan Young <[email protected]>
Discussion: 
https://postgr.es/m/CALdSSPjTS6TYe5=5NfMUBYZyQu5cn=abl6k5_ozjzgwqnwx...@mail.gmail.com
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e939332c6b1c7750f161424d8fbf8989b11cb5f6

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

Reply via email to