projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix error found by coverity: check if ctx is != NULL before calling BN_CTX_end()
[openssl.git]
/
crypto
/
rsa
/
rsa_gen.c
diff --git
a/crypto/rsa/rsa_gen.c
b/crypto/rsa/rsa_gen.c
index 383d6095f57c989522d1aa6ec860d7f8a7f10173..742f8b18e5addabe76b5f67f07845eeac0b9a89a 100644
(file)
--- 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;
}