diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-11 10:22:36 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-11 10:22:36 -0400 |
commit | 62adbcee392ba1061bf213174e8c59728e00860e (patch) | |
tree | b0a97dcc7e5d9ff3a60b638e45b254a234b83a41 /ssl/ssl_sess.c | |
parent | e2010b202a52be9120582537845f422a60d5d8c0 (diff) |
free NULL cleanup 10
Avoid checking for NULL before calling free functions. This gets
ssl.*free:
ssl_sess_cert_free ssl_free ssl_excert_free ssl_cert_free
SSL_free SSL_SRP_CTX_free SSL_SESSION_free SSL_CTX_free
SSL_CTX_SRP_CTX_free SSL_CONF_CTX_free
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r-- | ssl/ssl_sess.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 9273eb6c48..24e5d259d4 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -292,10 +292,8 @@ int ssl_get_new_session(SSL *s, int session) else ss->timeout = s->session_ctx->session_timeout; - if (s->session != NULL) { - SSL_SESSION_free(s->session); - s->session = NULL; - } + SSL_SESSION_free(s->session); + s->session = NULL; if (session) { if (s->version == SSL3_VERSION) { @@ -578,8 +576,7 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, s->session_ctx->stats.sess_hit++; - if (s->session != NULL) - SSL_SESSION_free(s->session); + SSL_SESSION_free(s->session); s->session = ret; s->verify_result = s->session->verify_result; return 1; |