From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Delay creation of SSL_CTX structure to allow cleanup
Date: Tue, 06 Oct 2026 11:52:22 +0000
Message-ID: <E1xE3iY-00000000Y0H-3Cjt@gemulon.postgresql.org> (raw)
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
------
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 instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: dgustafsson@postgresql.org
Subject: Re: pgsql: Delay creation of SSL_CTX structure to allow cleanup
In-Reply-To: <E1xE3iY-00000000Y0H-3Cjt@gemulon.postgresql.org>
References: <E1xE3iY-00000000Y0H-3Cjt@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox