From a2b5e64907a87d603ff649eccd7fdf151e34e4ba Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Thu, 3 Oct 2024 11:41:46 -0400 Subject: [PATCH] Fix build break when OPENSSL_NO_SSLKEYLOGFILE is not defined MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Tim Hudson Reviewed-by: Saša Nedvědický Reviewed-by: Hugo Landau Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/25297) --- ssl/ssl_lib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 27150db61c8..2087331f586 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -3893,12 +3893,11 @@ static long check_keylog_bio_free(BIO *b, int oper, const char *argp, /* * Note we _dont_ take the keylog_lock here * This is intentional, because we only free the keylog lock - * During SSL_CTX_free, in which we already posess the lock, so + * During SSL_CTX_free, in which we already posess the lock, so * Theres no need to grab it again here */ if (oper == BIO_CB_FREE) keylog_bio = NULL; -out: return ret; } @@ -4235,7 +4234,9 @@ SSL_CTX *SSL_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq, return ret; err: SSL_CTX_free(ret); +#ifndef OPENSSL_NO_SSLKEYLOG BIO_free(keylog_bio); +#endif return NULL; } -- 2.47.2