Don't leak rd_statlist when a relcache entry is dropped.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: fbcc9fe33c43a3fb79812b72960df4909a4551e5
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2021-03-19T00:37:09Z
Releases: 12.7
Don't leak rd_statlist when a relcache entry is dropped.

Although these lists are usually NIL, and even when not empty
are unlikely to be large, constant relcache update traffic could
eventually result in visible bloat of CacheMemoryContext.

Found via valgrind testing.
Back-patch to v10 where this field was added.

Discussion: https://postgr.es/m/3816764.1616104288@sss.pgh.pa.us

Files

PathChange+/−
src/backend/utils/cache/relcache.c modified +1 −0

Discussion