aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/rsa/rsa_x931g.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2019-03-19 09:58:09 +1000
committerRichard Levitte <levitte@openssl.org>2019-03-19 07:25:48 +0100
commitce1415ed2ce15305356cd028bcf7b9bc688d6d5c (patch)
treee9f4d5ed4bbb781d42b09c6a2c9bebd73fe8917f /crypto/rsa/rsa_x931g.c
parent226f2bf191ba8c2b33749ddc80c9ace051bebf80 (diff)
downloadopenssl-ce1415ed2ce15305356cd028bcf7b9bc688d6d5c.tar.gz
Added NULL check to BN_clear() & BN_CTX_end()
Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8518)
Diffstat (limited to 'crypto/rsa/rsa_x931g.c')
-rw-r--r--crypto/rsa/rsa_x931g.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/rsa/rsa_x931g.c b/crypto/rsa/rsa_x931g.c
index 160177721c..7a52083f15 100644
--- a/crypto/rsa/rsa_x931g.c
+++ b/crypto/rsa/rsa_x931g.c
@@ -133,8 +133,7 @@ int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1,
ret = 1;
err:
- if (ctx)
- BN_CTX_end(ctx);
+ BN_CTX_end(ctx);
BN_CTX_free(ctx);
BN_CTX_free(ctx2);
@@ -188,8 +187,7 @@ int RSA_X931_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e,
ok = 1;
error:
- if (ctx)
- BN_CTX_end(ctx);
+ BN_CTX_end(ctx);
BN_CTX_free(ctx);
if (ok)