Skip to content

Commit edd5737

Browse files
committed
Fix memory leak in GIN index scans.
The code had a query-lifespan memory leak when encountering GIN entries that have posting lists (rather than posting trees, ie, there are a relatively small number of heap tuples containing this index key value). With a suitable data distribution this could add up to a lot of leakage. Problem seems to have been introduced by commit 36a35c5, so back-patch to 9.4. Julien Rouhaud
1 parent 593f469 commit edd5737

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/backend/access/gin/ginget.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ collectMatchBitmap(GinBtreeData *btree, GinBtreeStack *stack,
278278
ipd = ginReadTuple(btree->ginstate, scanEntry->attnum, itup, &nipd);
279279
tbm_add_tuples(scanEntry->matchBitmap, ipd, nipd, false);
280280
scanEntry->predictNumberResult += GinGetNPosting(itup);
281+
pfree(ipd);
281282
}
282283

283284
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy