From c2b57cdd8d2c468fd3c1895b1d3aea730c70edcd Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 7 Jun 2014 14:35:31 +0000 Subject: BIO_free has an implicit NULL check, so do not bother checking for NULL before calling it. --- src/lib/libssl/ssl_rsa.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/lib/libssl/ssl_rsa.c') diff --git a/src/lib/libssl/ssl_rsa.c b/src/lib/libssl/ssl_rsa.c index 23891bf11b..02dfa63a09 100644 --- a/src/lib/libssl/ssl_rsa.c +++ b/src/lib/libssl/ssl_rsa.c @@ -118,8 +118,7 @@ SSL_use_certificate_file(SSL *ssl, const char *file, int type) end: if (x != NULL) X509_free(x); - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } @@ -243,8 +242,7 @@ SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type) ret = SSL_use_RSAPrivateKey(ssl, rsa); RSA_free(rsa); end: - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } @@ -318,8 +316,7 @@ SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type) ret = SSL_use_PrivateKey(ssl, pkey); EVP_PKEY_free(pkey); end: - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } @@ -447,8 +444,7 @@ SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type) end: if (x != NULL) X509_free(x); - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } @@ -531,8 +527,7 @@ SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type) ret = SSL_CTX_use_RSAPrivateKey(ctx, rsa); RSA_free(rsa); end: - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } @@ -603,8 +598,7 @@ SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type) ret = SSL_CTX_use_PrivateKey(ctx, pkey); EVP_PKEY_free(pkey); end: - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } @@ -703,7 +697,6 @@ SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file) end: if (x != NULL) X509_free(x); - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } -- cgit v1.2.3-55-g6feb