summaryrefslogtreecommitdiffstats
path: root/apps/s_server.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-05-01 14:37:16 -0400
committerRich Salz <rsalz@openssl.org>2015-05-01 14:37:16 -0400
commit25aaa98aa249d26391c1994d2de449562c8b8b99 (patch)
tree6f83efd87fa9fd832e8a456e9686143a29f1dab3 /apps/s_server.c
parent666964780a245c14e8f0eb6e13dd854a37387ea9 (diff)
free NULL cleanup -- coda
After the finale, the "real" final part. :) Do a recursive grep with "-B1 -w [a-zA-Z0-9_]*_free" to see if any of the preceeding lines are an "if NULL" check that can be removed. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'apps/s_server.c')
-rw-r--r--apps/s_server.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/apps/s_server.c b/apps/s_server.c
index 5fb275d0d8..fead620210 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -475,8 +475,7 @@ static int ebcdic_free(BIO *a)
{
if (a == NULL)
return (0);
- if (a->ptr != NULL)
- OPENSSL_free(a->ptr);
+ OPENSSL_free(a->ptr);
a->ptr = NULL;
a->init = 0;
a->flags = 0;
@@ -725,12 +724,9 @@ static int cert_status_cb(SSL *s, void *arg)
OPENSSL_free(port);
X509_email_free(aia);
}
- if (id)
- OCSP_CERTID_free(id);
- if (req)
- OCSP_REQUEST_free(req);
- if (resp)
- OCSP_RESPONSE_free(resp);
+ OCSP_CERTID_free(id);
+ OCSP_REQUEST_free(req);
+ OCSP_RESPONSE_free(resp);
return ret;
err:
ret = SSL_TLSEXT_ERR_ALERT_FATAL;
@@ -1928,30 +1924,22 @@ int s_server_main(int argc, char *argv[])
EVP_PKEY_free(s_dkey);
sk_X509_pop_free(s_chain, X509_free);
sk_X509_pop_free(s_dchain, X509_free);
- if (pass)
- OPENSSL_free(pass);
- if (dpass)
- OPENSSL_free(dpass);
+ OPENSSL_free(pass);
+ OPENSSL_free(dpass);
X509_VERIFY_PARAM_free(vpm);
free_sessions();
#ifndef OPENSSL_NO_TLSEXT
- if (tlscstatp.host)
- OPENSSL_free(tlscstatp.host);
- if (tlscstatp.port)
- OPENSSL_free(tlscstatp.port);
- if (tlscstatp.path)
- OPENSSL_free(tlscstatp.path);
- if (ctx2 != NULL)
+ OPENSSL_free(tlscstatp.host);
+ OPENSSL_free(tlscstatp.port);
+ OPENSSL_free(tlscstatp.path);
SSL_CTX_free(ctx2);
X509_free(s_cert2);
EVP_PKEY_free(s_key2);
BIO_free(serverinfo_in);
# ifndef OPENSSL_NO_NEXTPROTONEG
- if (next_proto.data)
- OPENSSL_free(next_proto.data);
+ OPENSSL_free(next_proto.data);
# endif
- if (alpn_ctx.data)
- OPENSSL_free(alpn_ctx.data);
+ OPENSSL_free(alpn_ctx.data);
#endif
ssl_excert_free(exc);
sk_OPENSSL_STRING_free(ssl_args);