Fix a memory leak in ssl_create_cipher_list
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 3 Nov 2021 08:19:39 +0000 (09:19 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 4 Nov 2021 15:55:28 +0000 (16:55 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16954)

(cherry picked from commit 3a069c1b0b4857b838186aeb55378195dfa50823)

ssl/ssl_ciph.c

index dd22e57c59f0301463c4b6c6615cc0b04b138b05..be7a969071942c1832a3f9f720d2c053dd2505d1 100644 (file)
@@ -1638,6 +1638,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(SSL_CTX *ctx,
         }
 
         if (!sk_SSL_CIPHER_push(cipherstack, sslc)) {
+            OPENSSL_free(co_list);
             sk_SSL_CIPHER_free(cipherstack);
             return NULL;
         }