]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
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:57:08 +0000 (16:57 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16955)

ssl/ssl_ciph.c

index 735a483c64486aaf3e173de3fefcef427a003ac3..0820f2cd0c71065c65a6ad3f3ac70b051ac26f23 100644 (file)
@@ -1601,6 +1601,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
     for (i = 0; i < sk_SSL_CIPHER_num(tls13_ciphersuites); i++) {
         if (!sk_SSL_CIPHER_push(cipherstack,
                                 sk_SSL_CIPHER_value(tls13_ciphersuites, i))) {
+            OPENSSL_free(co_list);
             sk_SSL_CIPHER_free(cipherstack);
             return NULL;
         }