summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_rsa.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-06-07 14:35:31 +0000
committerjsing <jsing@openbsd.org>2014-06-07 14:35:31 +0000
commit73c984695c120b2104b8032d74e4a7dca76f90fa (patch)
tree48c7e0738084198b2816ed8948806f9766075186 /lib/libssl/ssl_rsa.c
parentssl3_release_{read,write}_buffer() handle being called with NULL buffers, (diff)
downloadwireguard-openbsd-73c984695c120b2104b8032d74e4a7dca76f90fa.tar.xz
wireguard-openbsd-73c984695c120b2104b8032d74e4a7dca76f90fa.zip
BIO_free has an implicit NULL check, so do not bother checking for NULL
before calling it.
Diffstat (limited to 'lib/libssl/ssl_rsa.c')
-rw-r--r--lib/libssl/ssl_rsa.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/libssl/ssl_rsa.c b/lib/libssl/ssl_rsa.c
index 23891bf11b2..02dfa63a09d 100644
--- a/lib/libssl/ssl_rsa.c
+++ b/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);
}