Re: BUG #16160: Minor memory leak in case of starting postgres server with SSL encryption

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: duspensky@ya.ru, pgsql-bugs@lists.postgresql.org
Date: 2019-12-14T09:24:56Z
Lists: pgsql-bugs
On Fri, Dec 13, 2019 at 03:39:15PM +0900, Michael Paquier wrote:
> Attached is a patch, I'll go commit that if there are no objections.
> The DH handling does not really change regarding the way it gets
> free'd or not down to 0.9.8.

And committed.  Dmitry has pointed out offline that we need to do the
same with the error code path, and he is right as OpenSSL does not
touch the passed-in DH information for 0.9.8~.
--
Michael

Commits

  1. Fix memory leak when rejecting bogus DH parameters.

  2. Fix memory leak when initializing DH parameters in backend

  3. Avoid corner-case memory leak in SSL parameter processing.