postgresql/src
Tom Lane 397ea901e8 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
..
backend Fix memory leak when guc.c decides a setting can't be applied now. 2020-10-12 13:31:24 -04:00
bin Remove pointless error-code checking in pg_dump/parallel.c. 2020-10-10 15:33:54 -04:00
common Fix compilation warning in unicode_norm.c 2020-10-12 20:34:55 +09:00
fe_utils Standardize the printf format for st_size 2020-09-24 21:04:21 +02:00
include Choose ppc compare_exchange constant path for more operand values. 2020-10-11 21:31:37 -07:00
interfaces Recognize network-failure errnos as indicating hard connection loss. 2020-10-10 13:28:12 -04:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl plperl.h should #undef fstat along with stat and lstat. 2020-10-09 17:54:34 -04:00
port Minor cleanup for win32stat.c. 2020-10-12 11:13:02 -04:00
template Fix compiler warning for ppoll() on Cygwin 2019-12-22 23:20:00 +01:00
test Adjust cycle detection examples and tests 2020-10-12 08:01:21 +02:00
timezone Ensure that distributed timezone abbreviation files are plain ASCII. 2020-07-17 11:03:55 -04:00
tools Use perfect hash for NFC and NFKC Unicode Normalization quick check 2020-10-11 19:09:01 +09:00
tutorial Remove support for postfix (right-unary) operators. 2020-09-17 19:38:05 -04:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Split Makefile symbol CFLAGS_VECTOR into two symbols. 2020-09-06 21:28:16 -04:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00