aboutsummaryrefslogtreecommitdiffstats
path: root/ssl/bio_ssl.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-04-11 10:22:36 -0400
committerRich Salz <rsalz@openssl.org>2015-04-11 10:22:36 -0400
commit62adbcee392ba1061bf213174e8c59728e00860e (patch)
treeb0a97dcc7e5d9ff3a60b638e45b254a234b83a41 /ssl/bio_ssl.c
parente2010b202a52be9120582537845f422a60d5d8c0 (diff)
downloadopenssl-62adbcee392ba1061bf213174e8c59728e00860e.tar.gz
free NULL cleanup 10
Avoid checking for NULL before calling free functions. This gets ssl.*free: ssl_sess_cert_free ssl_free ssl_excert_free ssl_cert_free SSL_free SSL_SRP_CTX_free SSL_SESSION_free SSL_CTX_free SSL_CTX_SRP_CTX_free SSL_CONF_CTX_free Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'ssl/bio_ssl.c')
-rw-r--r--ssl/bio_ssl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c
index 0344b7e35b..7cf941d15b 100644
--- a/ssl/bio_ssl.c
+++ b/ssl/bio_ssl.c
@@ -125,7 +125,7 @@ static int ssl_free(BIO *a)
if (bs->ssl != NULL)
SSL_shutdown(bs->ssl);
if (a->shutdown) {
- if (a->init && (bs->ssl != NULL))
+ if (a->init)
SSL_free(bs->ssl);
a->init = 0;
a->flags = 0;
@@ -416,8 +416,7 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
break;
case BIO_CTRL_DUP:
dbio = (BIO *)ptr;
- if (((BIO_SSL *)dbio->ptr)->ssl != NULL)
- SSL_free(((BIO_SSL *)dbio->ptr)->ssl);
+ SSL_free(((BIO_SSL *)dbio->ptr)->ssl);
((BIO_SSL *)dbio->ptr)->ssl = SSL_dup(ssl);
((BIO_SSL *)dbio->ptr)->renegotiate_count =
((BIO_SSL *)b->ptr)->renegotiate_count;