mirror of
https://github.com/postgres/postgres.git
synced 2026-07-08 01:01:01 -04:00
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
This commit is contained in:
parent
56e892a494
commit
80cfd8aef6
1 changed files with 3 additions and 0 deletions
|
|
@ -637,6 +637,9 @@ gin_check_parent_keys_consistency(Relation rel,
|
|||
pfree(ipd);
|
||||
}
|
||||
|
||||
if (prev_tuple)
|
||||
pfree(prev_tuple);
|
||||
|
||||
prev_tuple = CopyIndexTuple(idxtuple);
|
||||
prev_attnum = current_attnum;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue