Fix memory leak introduced in commit 7df159a620.

Amit Kapila <akapila@postgresql.org>

Commit: 62f4dd3796dac30e2230baa4afbb7d2a626d9373
Author: Amit Kapila <akapila@postgresql.org>
Date: 2019-10-21T03:34:35Z
Releases: 12.1
Fix memory leak introduced in commit 7df159a620.

We memorize all internal and empty leaf pages in the 1st vacuum stage for
gist indexes.  They are used in the 2nd stage, to delete all the empty
pages.  There was a memory context page_set_context for this purpose, but
we never used it.

Reported-by: Amit Kapila
Author: Dilip Kumar
Reviewed-by: Amit Kapila
Backpatch-through: 12, where it got introduced
Discussion: https://postgr.es/m/CAA4eK1LGr+MN0xHZpJ2dfS8QNQ1a_aROKowZB+MPNep8FVtwAA@mail.gmail.com

Files

PathChange+/−
src/backend/access/gist/gistvacuum.c modified +10 −0

Discussion