summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_ciph.c
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-03-18 01:48:09 +0100
committerPauli <ppzgs1@gmail.com>2021-03-20 01:07:59 +0100
commite22105d1b32eaf6ae091da3477d0434dd223cd1f (patch)
treeb9d5261420e974a1a8beaed44cca4e5bd19f610d /ssl/ssl_ciph.c
parenttest: fix coverity 1414449 & 1414471: resource leak (diff)
downloadopenssl-e22105d1b32eaf6ae091da3477d0434dd223cd1f.tar.xz
openssl-e22105d1b32eaf6ae091da3477d0434dd223cd1f.zip
ssl: fix coverity 1451495: resource leak
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14596)
Diffstat (limited to 'ssl/ssl_ciph.c')
-rw-r--r--ssl/ssl_ciph.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 0b6f01ccc1..80014a31fd 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;