summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_ciph.c
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-03-18 10:48:09 +1000
committerPauli <ppzgs1@gmail.com>2021-03-20 10:07:59 +1000
commite22105d1b32eaf6ae091da3477d0434dd223cd1f (patch)
treeb9d5261420e974a1a8beaed44cca4e5bd19f610d /ssl/ssl_ciph.c
parent65bf029d498e237c0c5b3f098b7fe932f2958e84 (diff)
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;