Content-Length: 257711 | pFad | http://github.com/postgrespro/postgres_cluster/commit/f0e766bd7f77774075297526bd2da8f3de226c1f

C1 Fix memory leak in GIN index scans. · postgrespro/postgres_cluster@f0e766b · GitHub
Skip to content

Commit f0e766b

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 6f0d6a5 commit f0e766b

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
@@ -281,6 +281,7 @@ collectMatchBitmap(GinBtreeData *btree, GinBtreeStack *stack,
281281
ipd = ginReadTuple(btree->ginstate, scanEntry->attnum, itup, &nipd);
282282
tbm_add_tuples(scanEntry->matchBitmap, ipd, nipd, false);
283283
scanEntry->predictNumberResult += GinGetNPosting(itup);
284+
pfree(ipd);
284285
}
285286

286287
/*

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/f0e766bd7f77774075297526bd2da8f3de226c1f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy