summaryrefslogtreecommitdiff
path: root/lib/libcrypto/rsa/rsa_gen.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/rsa/rsa_gen.c')
-rw-r--r--lib/libcrypto/rsa/rsa_gen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libcrypto/rsa/rsa_gen.c b/lib/libcrypto/rsa/rsa_gen.c
index adb5e34da56..dd1422cc98b 100644
--- a/lib/libcrypto/rsa/rsa_gen.c
+++ b/lib/libcrypto/rsa/rsa_gen.c
@@ -184,7 +184,8 @@ err:
RSAerr(RSA_F_RSA_GENERATE_KEY,ERR_LIB_BN);
ok=0;
}
- BN_CTX_end(ctx);
+ if (ctx != NULL)
+ BN_CTX_end(ctx);
BN_CTX_free(ctx);
BN_CTX_free(ctx2);