pgsql: Fix memory leak when initializing DH parameters in backend

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix memory leak when initializing DH parameters in backend
Date: 2019-12-14 09:18:18
Message-ID: E1ig3Z4-0000jK-Dp@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Note that as SSL parameters can be reloaded, this can cause an accumulation
of memory leaked. As the leak is minor, no backpatch is done.

Reported-by: Dmitry Uspenskiy
Discussion: https://postgr.es/m/16160-18367e56e9a28264@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e0e569e1d192c3fed942257302f24b550cf982f4

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

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-12-14 18:50:55 pgsql: Prevent overly-aggressive collapsing of joins to RTE_RESULT rela
Previous Message Thomas Munro 2019-12-14 06:09:38 pgsql: Fix mdsyncfiletag(), take II.