postgresql/contrib/amcheck
Michael Paquier 80cfd8aef6 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 14ffaece0f.

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
2026-07-06 09:32:28 +09:00
..
expected amcheck: Improve error message for partitioned index target. 2025-07-14 20:05:10 +09:00
sql amcheck: Improve error message for partitioned index target. 2025-07-14 20:05:10 +09:00
t amcheck: Fix snapshot usage in bt_index_parent_check 2026-01-21 18:55:43 +01:00
.gitignore Add .gitignore to contrib/amcheck. 2017-03-09 22:45:24 -05:00
amcheck--1.0--1.1.sql Add amcheck verification of heap relations belonging to btree indexes. 2018-03-31 19:52:01 -07:00
amcheck--1.0.sql Add amcheck extension to contrib. 2017-03-09 16:33:02 -08:00
amcheck--1.1--1.2.sql Allow amcheck to re-find tuples using new search. 2019-03-20 10:41:36 -07:00
amcheck--1.2--1.3.sql Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
amcheck--1.3--1.4.sql Teach contrib/amcheck to check the unique constraint violation 2023-10-28 00:21:23 +03:00
amcheck--1.4--1.5.sql amcheck: Add gin_index_check() to verify GIN index 2025-03-29 15:44:29 +01:00
amcheck.control amcheck: Add gin_index_check() to verify GIN index 2025-03-29 15:44:29 +01:00
Makefile amcheck: Add gin_index_check() to verify GIN index 2025-03-29 15:44:29 +01:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
verify_common.c Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
verify_common.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
verify_gin.c amcheck: Fix memory leak with gin_index_check() 2026-07-06 09:32:28 +09:00
verify_heapam.c Don't include storage/lock.h in so many headers 2026-03-24 17:11:12 +01:00
verify_nbtree.c amcheck: Use correct varlena size accessor in bt_normalize_tuple() 2026-06-14 04:04:48 +03:00