From 55c86f27865fc5782686858122d39a69c5f6e699 Mon Sep 17 00:00:00 2001
From: jsing <>
Date: Mon, 13 Oct 2014 13:47:31 +0000
Subject: BIO_free() and SSL_CTX_free() have explicit NULL checks, so there is
 no need to have additional checks here.

---
 src/regress/lib/libssl/ssl/ssltest.c | 45 +++++++++++++-----------------------
 1 file 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:
 	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);
 }
 
-- 
cgit v1.2.3-55-g6feb