From e22105d1b32eaf6ae091da3477d0434dd223cd1f Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 18 Mar 2021 10:48:09 +1000 Subject: [PATCH] ssl: fix coverity 1451495: resource leak Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14596) --- ssl/ssl_ciph.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 0b6f01ccc10..80014a31fd4 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -1384,8 +1384,10 @@ static int update_cipher_list(STACK_OF(SSL_CIPHER) **cipher_list, sk_SSL_CIPHER_insert(tmp_cipher_list, sk_SSL_CIPHER_value(tls13_ciphersuites, i), i); - if (!update_cipher_list_by_id(cipher_list_by_id, tmp_cipher_list)) + if (!update_cipher_list_by_id(cipher_list_by_id, tmp_cipher_list)) { + sk_SSL_CIPHER_free(tmp_cipher_list); return 0; + } sk_SSL_CIPHER_free(*cipher_list); *cipher_list = tmp_cipher_list; -- 2.47.2