postgresql/src/backend/utils
Tom Lane 43ca5e07d1 Fix memory leak when guc.c decides a setting can't be applied now.
The prohibitValueChange code paths in set_config_option(), which
are executed whenever we re-read a PGC_POSTMASTER variable from
postgresql.conf, neglected to free anything before exiting.  Thus
we'd leak the proposed new value of a PGC_STRING variable, as noted
by BoChen in bug #16666.  For all variable types, if the check hook
creates an "extra" chunk, we'd also leak that.

These are malloc not palloc chunks, so there is no mechanism for
recovering the leaks before process exit.  Fortunately, the values
are typically not very large, meaning you'd have to go through an
awful lot of SIGHUP configuration-reload cycles to make the leakage
amount to anything.  Still, for a long-lived postmaster process it
could potentially be a problem.

Oversight in commit 2594cf0e8.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/16666-2c41a4eec61b03e1@postgresql.org
2020-10-12 13:31:24 -04:00
..
adt Fix handling of BC years in to_date/to_timestamp. 2020-09-30 15:40:23 -04:00
cache Preserve clustered index after rewrites with ALTER TABLE 2020-04-06 11:06:07 +09:00
error Disallow setting client_min_messages higher than ERROR. 2018-11-08 17:33:26 -05:00
fmgr Avoid holding a directory FD open across assorted SRF calls. 2020-03-16 21:05:29 -04:00
hash Reorganize our CRC source files again. 2015-04-14 17:03:42 +03:00
init Consistently test for in-use shared memory. 2019-04-12 22:41:42 -07:00
mb Avoid unnecessary out-of-memory errors during encoding conversion. 2019-10-03 17:34:26 -04:00
misc Fix memory leak when guc.c decides a setting can't be applied now. 2020-10-12 13:31:24 -04:00
mmgr Allow repalloc() to give back space when a large chunk is downsized. 2019-10-03 13:56:26 -04:00
resowner Update copyright for 2015 2015-01-06 11:43:47 -05:00
sort Backpatch tuplesort.c assertion. 2020-07-29 16:00:48 -07:00
time Fix pruning of locked and updated tuples. 2017-12-14 18:20:48 -08:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
Gen_dummy_probes.pl Remove dependency on psed for MSVC builds. 2016-03-19 18:44:04 -04:00
Gen_dummy_probes.sed Update copyright for 2015 2015-01-06 11:43:47 -05:00
Gen_fmgrtab.pl Allow forcing nullness of columns during bootstrap. 2015-02-21 22:31:54 +01:00
generate-errcodes.pl Update copyright for 2015 2015-01-06 11:43:47 -05:00
Makefile Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
probes.d Update copyright for 2015 2015-01-06 11:43:47 -05:00