pgsql: Delay creation of SSL_CTX structure to allow cleanup - Mailing list pgsql-committers

From Daniel Gustafsson
Subject pgsql: Delay creation of SSL_CTX structure to allow cleanup
Date
Msg-id E1xE3ii-00000000Y1V-1ekZ@gemulon.postgresql.org
Whole thread
List pgsql-committers
Delay creation of SSL_CTX structure to allow cleanup

Avoid initializing the OpenSSL SSL_CTX structure for a new host
until it has been checked for errors.  The cleanup can only see
hosts which were successfully added so the previous coding would
leak the SSL_CTX on failed reloads.

Author: Zsolt Parragi <zsolt.parragi@percona.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Rui Zhao <zhaorui126@gmail.com>
Discussion: https://postgr.es/m/A1745424-7110-41E9-B98C-3CED1A034A8F@yesql.se
Backpatch-through: 19

Branch
------
REL_19_STABLE

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

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


pgsql-committers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: pgsql: Keep current ssl_sni setting on SSL config reload failure
Next
From: Nathan Bossart
Date:
Subject: pgsql: Fix COPY FROM ... WHERE for negated operators.