pgsql: Fix memory leak when initializing DH parameters in backend - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix memory leak when initializing DH parameters in backend
Date
Msg-id E1lNelj-0004vh-0c@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix memory leak when initializing DH parameters in backend

When loading DH parameters used for the generation of ephemeral DH keys
in the backend, the code has never bothered releasing the memory used
for the DH information loaded from a file or from libpq's default.  This
commit makes sure that the information is properly free()'d.

Back-patch of e0e569e1d.  We originally thought the leak was minor and
not worth back-patching, but Jelte Fennema pointed out that repeated
SIGHUP's can result in very serious bloat of the postmaster, which is
then multiplied by being duplicated into eadh forked child.

Back-patch to v10; the code looked different before c0a15e07c,
and didn't have a leak in the actually-live code paths.

Michael Paquier

Discussion: https://postgr.es/m/16160-18367e56e9a28264@postgresql.org

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7d9629ed2f69cd123514e0338cb20afca9abcd59

Modified Files
--------------
src/backend/libpq/be-secure-openssl.c | 3 +++
1 file changed, 3 insertions(+)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix memory leak when rejecting bogus DH parameters.
Next
From: Tom Lane
Date:
Subject: pgsql: Fix up pg_dump's handling of per-attribute compression options.