diff options
author | jsing <> | 2014-10-13 13:47:31 +0000 |
---|---|---|
committer | jsing <> | 2014-10-13 13:47:31 +0000 |
commit | 55c86f27865fc5782686858122d39a69c5f6e699 (patch) | |
tree | b5bdfe9dfd7e669255bb18dccb31f6edea538a6b /src | |
parent | 8890ce1e761bbb200cb6447b579ed30d21164f9f (diff) | |
download | openbsd-55c86f27865fc5782686858122d39a69c5f6e699.tar.gz openbsd-55c86f27865fc5782686858122d39a69c5f6e699.tar.bz2 openbsd-55c86f27865fc5782686858122d39a69c5f6e699.zip |
BIO_free() and SSL_CTX_free() have explicit NULL checks, so there is no
need to have additional checks here.
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libssl/ssl/ssltest.c | 45 |
1 files changed, 16 insertions, 29 deletions
diff --git a/src/regress/lib/libssl/ssl/ssltest.c b/src/regress/lib/libssl/ssl/ssltest.c index 5587c0e424..fd8031983e 100644 --- a/src/regress/lib/libssl/ssl/ssltest.c +++ b/src/regress/lib/libssl/ssl/ssltest.c | |||
@@ -813,13 +813,9 @@ bad: | |||
813 | SSL_free(c_ssl); | 813 | SSL_free(c_ssl); |
814 | 814 | ||
815 | end: | 815 | end: |
816 | if (s_ctx != NULL) | 816 | SSL_CTX_free(s_ctx); |
817 | SSL_CTX_free(s_ctx); | 817 | SSL_CTX_free(c_ctx); |
818 | if (c_ctx != NULL) | 818 | BIO_free(bio_stdout); |
819 | SSL_CTX_free(c_ctx); | ||
820 | |||
821 | if (bio_stdout != NULL) | ||
822 | BIO_free(bio_stdout); | ||
823 | 819 | ||
824 | free_tmp_rsa(); | 820 | free_tmp_rsa(); |
825 | #ifndef OPENSSL_NO_ENGINE | 821 | #ifndef OPENSSL_NO_ENGINE |
@@ -830,8 +826,8 @@ end: | |||
830 | ERR_remove_thread_state(NULL); | 826 | ERR_remove_thread_state(NULL); |
831 | EVP_cleanup(); | 827 | EVP_cleanup(); |
832 | CRYPTO_mem_leaks(bio_err); | 828 | CRYPTO_mem_leaks(bio_err); |
833 | if (bio_err != NULL) | 829 | BIO_free(bio_err); |
834 | BIO_free(bio_err); | 830 | |
835 | exit(ret); | 831 | exit(ret); |
836 | return ret; | 832 | return ret; |
837 | } | 833 | } |
@@ -1183,18 +1179,12 @@ end: | |||
1183 | err: | 1179 | err: |
1184 | ERR_print_errors(bio_err); | 1180 | ERR_print_errors(bio_err); |
1185 | 1181 | ||
1186 | if (server) | 1182 | BIO_free(server); |
1187 | BIO_free(server); | 1183 | BIO_free(server_io); |
1188 | if (server_io) | 1184 | BIO_free(client); |
1189 | BIO_free(server_io); | 1185 | BIO_free(client_io); |
1190 | if (client) | 1186 | BIO_free(s_ssl_bio); |
1191 | BIO_free(client); | 1187 | BIO_free(c_ssl_bio); |
1192 | if (client_io) | ||
1193 | BIO_free(client_io); | ||
1194 | if (s_ssl_bio) | ||
1195 | BIO_free(s_ssl_bio); | ||
1196 | if (c_ssl_bio) | ||
1197 | BIO_free(c_ssl_bio); | ||
1198 | 1188 | ||
1199 | return ret; | 1189 | return ret; |
1200 | } | 1190 | } |
@@ -1454,14 +1444,11 @@ err: | |||
1454 | c_ssl->wbio = NULL; | 1444 | c_ssl->wbio = NULL; |
1455 | } | 1445 | } |
1456 | 1446 | ||
1457 | if (c_to_s != NULL) | 1447 | BIO_free(c_to_s); |
1458 | BIO_free(c_to_s); | 1448 | BIO_free(s_to_c); |
1459 | if (s_to_c != NULL) | 1449 | BIO_free_all(c_bio); |
1460 | BIO_free(s_to_c); | 1450 | BIO_free_all(s_bio); |
1461 | if (c_bio != NULL) | 1451 | |
1462 | BIO_free_all(c_bio); | ||
1463 | if (s_bio != NULL) | ||
1464 | BIO_free_all(s_bio); | ||
1465 | return (ret); | 1452 | return (ret); |
1466 | } | 1453 | } |
1467 | 1454 | ||