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>
This commit is contained in:
Rich Salz
2015-04-11 10:22:36 -04:00
parent e2010b202a
commit 62adbcee39
16 changed files with 30 additions and 47 deletions

View File

@@ -2024,8 +2024,7 @@ int MAIN(int argc, char **argv)
if (next_proto.data)
OPENSSL_free(next_proto.data);
#endif
if (ctx != NULL)
SSL_CTX_free(ctx);
SSL_CTX_free(ctx);
if (cert)
X509_free(cert);
if (crls)
@@ -2040,8 +2039,7 @@ int MAIN(int argc, char **argv)
ssl_excert_free(exc);
if (ssl_args)
sk_OPENSSL_STRING_free(ssl_args);
if (cctx)
SSL_CONF_CTX_free(cctx);
SSL_CONF_CTX_free(cctx);
#ifndef OPENSSL_NO_JPAKE
if (jpake_secret && psk_key)
OPENSSL_free(psk_key);