diff options
author | Nils Larsch <nils@openssl.org> | 2006-03-13 23:14:57 +0000 |
---|---|---|
committer | Nils Larsch <nils@openssl.org> | 2006-03-13 23:14:57 +0000 |
commit | 47d556664695f6bbde0d0ab0c1261ed0070c81fd (patch) | |
tree | ef4e7c5c8e408fd774538a45826c340ee3b8480a /crypto/rsa/rsa_gen.c | |
parent | 90bdfd97a68ed56d926a44b3d37f51b2450f5bb7 (diff) | |
download | openssl-47d556664695f6bbde0d0ab0c1261ed0070c81fd.tar.gz |
fix error found by coverity: check if ctx is != NULL before calling BN_CTX_end()
Diffstat (limited to 'crypto/rsa/rsa_gen.c')
-rw-r--r-- | crypto/rsa/rsa_gen.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c index 383d6095f5..742f8b18e5 100644 --- a/crypto/rsa/rsa_gen.c +++ b/crypto/rsa/rsa_gen.c @@ -183,8 +183,11 @@ err: RSAerr(RSA_F_RSA_BUILTIN_KEYGEN,ERR_LIB_BN); ok=0; } - BN_CTX_end(ctx); - BN_CTX_free(ctx); + if (ctx != NULL) + { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } return ok; } |