summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/rsa/rsa_chk.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-07-10 07:43:11 +0000
committerjsing <jsing@openbsd.org>2014-07-10 07:43:11 +0000
commit323e3475f1da3db6e3b7e4f8288ec466cec2ddcc (patch)
treedeaa0135b2ed87962dd5d5ec20a325746bd38f3e /lib/libcrypto/rsa/rsa_chk.c
parentUse a while loop instead of an ifdowhile loop. (diff)
downloadwireguard-openbsd-323e3475f1da3db6e3b7e4f8288ec466cec2ddcc.tar.xz
wireguard-openbsd-323e3475f1da3db6e3b7e4f8288ec466cec2ddcc.zip
BN_free, BN_clear_free, BN_CTX_free, BN_BLINDING_free and BN_MONT_CTX_free
all have implicit NULL checks, so we do not need them here. ok miod@
Diffstat (limited to 'lib/libcrypto/rsa/rsa_chk.c')
-rw-r--r--lib/libcrypto/rsa/rsa_chk.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/libcrypto/rsa/rsa_chk.c b/lib/libcrypto/rsa/rsa_chk.c
index 0f9e0944db1..c247a8d80e8 100644
--- a/lib/libcrypto/rsa/rsa_chk.c
+++ b/lib/libcrypto/rsa/rsa_chk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_chk.c,v 1.8 2014/07/09 19:51:38 jsing Exp $ */
+/* $OpenBSD: rsa_chk.c,v 1.9 2014/07/10 07:43:11 jsing Exp $ */
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
@@ -52,7 +52,6 @@
#include <openssl/err.h>
#include <openssl/rsa.h>
-
int
RSA_check_key(const RSA *key)
{
@@ -203,17 +202,12 @@ RSA_check_key(const RSA *key)
}
err:
- if (i != NULL)
- BN_free(i);
- if (j != NULL)
- BN_free(j);
- if (k != NULL)
- BN_free(k);
- if (l != NULL)
- BN_free(l);
- if (m != NULL)
- BN_free(m);
- if (ctx != NULL)
- BN_CTX_free(ctx);
+ BN_free(i);
+ BN_free(j);
+ BN_free(k);
+ BN_free(l);
+ BN_free(m);
+ BN_CTX_free(ctx);
+
return (ret);
}