aboutsummaryrefslogtreecommitdiffstats
path: root/ssl/ssl_sess.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 /ssl/ssl_sess.c
parent666964780a245c14e8f0eb6e13dd854a37387ea9 (diff)
downloadopenssl-25aaa98aa249d26391c1994d2de449562c8b8b99.tar.gz
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 'ssl/ssl_sess.c')
-rw-r--r--ssl/ssl_sess.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index a376875803..1a00c38882 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -733,31 +733,23 @@ void SSL_SESSION_free(SSL_SESSION *ss)
OPENSSL_cleanse(ss->session_id, sizeof ss->session_id);
ssl_sess_cert_free(ss->sess_cert);
X509_free(ss->peer);
- if (ss->ciphers != NULL)
- sk_SSL_CIPHER_free(ss->ciphers);
+ sk_SSL_CIPHER_free(ss->ciphers);
#ifndef OPENSSL_NO_TLSEXT
- if (ss->tlsext_hostname != NULL)
- OPENSSL_free(ss->tlsext_hostname);
- if (ss->tlsext_tick != NULL)
- OPENSSL_free(ss->tlsext_tick);
+ OPENSSL_free(ss->tlsext_hostname);
+ OPENSSL_free(ss->tlsext_tick);
# ifndef OPENSSL_NO_EC
ss->tlsext_ecpointformatlist_length = 0;
- if (ss->tlsext_ecpointformatlist != NULL)
- OPENSSL_free(ss->tlsext_ecpointformatlist);
+ OPENSSL_free(ss->tlsext_ecpointformatlist);
ss->tlsext_ellipticcurvelist_length = 0;
- if (ss->tlsext_ellipticcurvelist != NULL)
- OPENSSL_free(ss->tlsext_ellipticcurvelist);
+ OPENSSL_free(ss->tlsext_ellipticcurvelist);
# endif /* OPENSSL_NO_EC */
#endif
#ifndef OPENSSL_NO_PSK
- if (ss->psk_identity_hint != NULL)
- OPENSSL_free(ss->psk_identity_hint);
- if (ss->psk_identity != NULL)
- OPENSSL_free(ss->psk_identity);
+ OPENSSL_free(ss->psk_identity_hint);
+ OPENSSL_free(ss->psk_identity);
#endif
#ifndef OPENSSL_NO_SRP
- if (ss->srp_username != NULL)
- OPENSSL_free(ss->srp_username);
+ OPENSSL_free(ss->srp_username);
#endif
OPENSSL_clear_free(ss, sizeof(*ss));
}