From 25b39ed6ca70d28ec65dacb897a16688db527768 Mon Sep 17 00:00:00 2001 From: Francesco Giacomini Date: Wed, 8 Mar 2023 10:22:48 +0100 Subject: [PATCH] Fix memory leaks and double deletes They are reported from the runtime checks on EL9 --- src/sslutils/sslutils.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sslutils/sslutils.c b/src/sslutils/sslutils.c index 8b0f4c46..4fead093 100644 --- a/src/sslutils/sslutils.c +++ b/src/sslutils/sslutils.c @@ -767,6 +767,9 @@ proxy_genreq( if (RSA_generate_key_ex(rsa, rbits, rsa_exp, cb)) { BN_free(rsa_exp); + rsa_exp = NULL; + BN_GENCB_free(cb); + cb = NULL; } else { @@ -774,7 +777,11 @@ proxy_genreq( goto err; } - if (!EVP_PKEY_assign_RSA(pkey,rsa)) + if (EVP_PKEY_assign_RSA(pkey,rsa)) + { + rsa = NULL; + } + else { PRXYerr(PRXYERR_F_PROXY_GENREQ,PRXYERR_R_PROCESS_PROXY_KEY); goto err;