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 <[email protected]>
Reviewed-by: Daniel Gustafsson <[email protected]>
Reviewed-by: Rui Zhao <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 19

Branch
------
master

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

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

Reply via email to