]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ssl: fix coverity 1451495: resource leak
authorPauli <ppzgs1@gmail.com>
Thu, 18 Mar 2021 00:48:09 +0000 (10:48 +1000)
committerPauli <ppzgs1@gmail.com>
Sat, 20 Mar 2021 00:07:59 +0000 (10:07 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14596)

ssl/ssl_ciph.c

index 0b6f01ccc10d96125597e1b7e00d3fe9aef78912..80014a31fd44181ecd8dcb9a04a78708d9c0804a 100644 (file)
@@ -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;