Fix memory leaks in ssl_old_test.c
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 11 Sep 2023 10:26:46 +0000 (12:26 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 13 Sep 2023 12:31:27 +0000 (14:31 +0200)
commitba3c334eca591cb46bf9eb8821363f49c846117d
treec0063a9ab6cefc3fbe806a96ccfd5361f74c2d12
parent094c9297fa7463024a7ca139d3f90b508f49fd91
Fix memory leaks in ssl_old_test.c

This fixes a few memory leaks reported in #22049.

If SSL_CTX_set0_tmp_dh_pkey rejects the temp dh key
due to security restrictions (even when @SECLEVEL=0 is used!)
then the caller has to delete the PKEY object.
That is different to how the deprecated
SSL_CTX_set_tmp_dh_pkey was designed to work.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22060)

(cherry picked from commit 21f0b80cd4b32ba80843b812b01a6056daf14093)
test/ssl_old_test.c