diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2014-10-13 13:47:32 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2014-10-13 13:47:32 +0000 |
commit | efa17d7e4edeadf8ad96018ca73a6163618a026e (patch) | |
tree | d409709e34c4d725d52227ea0f2026d14c3ca6f5 /regress/lib | |
parent | bc71cde68d310f3f1e3ce7186af254575524f758 (diff) |
BIO_free() and SSL_CTX_free() have explicit NULL checks, so there is no
need to have additional checks here.
Diffstat (limited to 'regress/lib')
-rw-r--r-- | regress/lib/libssl/ssl/ssltest.c | 45 |
1 files changed, 16 insertions, 29 deletions
diff --git a/regress/lib/libssl/ssl/ssltest.c b/regress/lib/libssl/ssl/ssltest.c index 5587c0e424e..fd8031983ef 100644 --- a/regress/lib/libssl/ssl/ssltest.c +++ b/regress/lib/libssl/ssl/ssltest.c @@ -813,13 +813,9 @@ bad: SSL_free(c_ssl); end: - if (s_ctx != NULL) - SSL_CTX_free(s_ctx); - if (c_ctx != NULL) - SSL_CTX_free(c_ctx); - - if (bio_stdout != NULL) - BIO_free(bio_stdout); + SSL_CTX_free(s_ctx); + SSL_CTX_free(c_ctx); + BIO_free(bio_stdout); free_tmp_rsa(); #ifndef OPENSSL_NO_ENGINE @@ -830,8 +826,8 @@ end: ERR_remove_thread_state(NULL); EVP_cleanup(); CRYPTO_mem_leaks(bio_err); - if (bio_err != NULL) - BIO_free(bio_err); + BIO_free(bio_err); + exit(ret); return ret; } @@ -1183,18 +1179,12 @@ end: err: ERR_print_errors(bio_err); - if (server) - BIO_free(server); - if (server_io) - BIO_free(server_io); - if (client) - BIO_free(client); - if (client_io) - BIO_free(client_io); - if (s_ssl_bio) - BIO_free(s_ssl_bio); - if (c_ssl_bio) - BIO_free(c_ssl_bio); + BIO_free(server); + BIO_free(server_io); + BIO_free(client); + BIO_free(client_io); + BIO_free(s_ssl_bio); + BIO_free(c_ssl_bio); return ret; } @@ -1454,14 +1444,11 @@ err: c_ssl->wbio = NULL; } - if (c_to_s != NULL) - BIO_free(c_to_s); - if (s_to_c != NULL) - BIO_free(s_to_c); - if (c_bio != NULL) - BIO_free_all(c_bio); - if (s_bio != NULL) - BIO_free_all(s_bio); + BIO_free(c_to_s); + BIO_free(s_to_c); + BIO_free_all(c_bio); + BIO_free_all(s_bio); + return (ret); } |