From 85fb6fdaed74d6091817ce5da17fcc737f36a51f Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sat, 20 Jun 2015 15:37:22 +0100 Subject: [PATCH] remove unnecessary NULL checks Reviewed-by: Rich Salz --- ssl/s3_enc.c | 3 +-- ssl/s3_lib.c | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c index dd93e251ae..bde19e1fb8 100644 --- a/ssl/s3_enc.c +++ b/ssl/s3_enc.c @@ -477,8 +477,7 @@ void ssl3_cleanup_key_block(SSL *s) void ssl3_init_finished_mac(SSL *s) { BIO_free(s->s3->handshake_buffer); - if (s->s3->handshake_dgst) - ssl3_free_digest_list(s); + ssl3_free_digest_list(s); s->s3->handshake_buffer = BIO_new(BIO_s_mem()); (void)BIO_set_close(s->s3->handshake_buffer, BIO_CLOSE); } diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 878464234b..03078016e6 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -2906,8 +2906,7 @@ void ssl3_free(SSL *s) OPENSSL_clear_free(s->s3->tmp.pms, s->s3->tmp.pmslen); OPENSSL_free(s->s3->tmp.peer_sigalgs); BIO_free(s->s3->handshake_buffer); - if (s->s3->handshake_dgst) - ssl3_free_digest_list(s); + ssl3_free_digest_list(s); OPENSSL_free(s->s3->alpn_selected); #ifndef OPENSSL_NO_SRP @@ -2943,9 +2942,7 @@ void ssl3_clear(SSL *s) init_extra = s->s3->init_extra; BIO_free(s->s3->handshake_buffer); s->s3->handshake_buffer = NULL; - if (s->s3->handshake_dgst) { - ssl3_free_digest_list(s); - } + ssl3_free_digest_list(s); if (s->s3->alpn_selected) { OPENSSL_free(s->s3->alpn_selected); -- 2.25.1