diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-11 16:22:36 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-11 16:22:36 +0200 |
commit | 62adbcee392ba1061bf213174e8c59728e00860e (patch) | |
tree | b0a97dcc7e5d9ff3a60b638e45b254a234b83a41 /demos | |
parent | The wrong ifdef is used to guard usage of PSK code (diff) | |
download | openssl-62adbcee392ba1061bf213174e8c59728e00860e.tar.xz openssl-62adbcee392ba1061bf213174e8c59728e00860e.zip |
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 'demos')
-rw-r--r-- | demos/bio/sconnect.c | 3 | ||||
-rw-r--r-- | demos/easy_tls/easy-tls.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/demos/bio/sconnect.c b/demos/bio/sconnect.c index e6eddb1c05..73280b576a 100644 --- a/demos/bio/sconnect.c +++ b/demos/bio/sconnect.c @@ -106,8 +106,7 @@ char *argv[]; ERR_print_errors_fp(stderr); } BIO_free_all(out); - if (ssl_ctx != NULL) - SSL_CTX_free(ssl_ctx); + SSL_CTX_free(ssl_ctx); exit(!ret); return (ret); } diff --git a/demos/easy_tls/easy-tls.c b/demos/easy_tls/easy-tls.c index 3475551d6a..1a0a03abe6 100644 --- a/demos/easy_tls/easy-tls.c +++ b/demos/easy_tls/easy-tls.c @@ -804,8 +804,7 @@ SSL_CTX *tls_create_ctx(struct tls_create_ctx_args a, void *apparg) err: tls_openssl_errors(err_pref_1, err_pref_2, NULL, apparg); err_return: - if (ret != NULL) - SSL_CTX_free(ret); + SSL_CTX_free(ret); return NULL; } |