free NULL cleanup
Start ensuring all OpenSSL "free" routines allow NULL, and remove
any if check before calling them.
This gets DH_free, DSA_free, RSA_free
Reviewed-by: Matt Caswell <matt@openssl.org>
diff --git a/apps/s_server.c b/apps/s_server.c
index 298e665..97aa23d 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -3180,8 +3180,7 @@
}
if (!BN_set_word(bn, RSA_F4) || ((rsa_tmp = RSA_new()) == NULL) ||
!RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL)) {
- if (rsa_tmp)
- RSA_free(rsa_tmp);
+ RSA_free(rsa_tmp);
rsa_tmp = NULL;
}
if (!s_quiet) {