aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ec/ecp_smpl.c
diff options
context:
space:
mode:
authorNils Larsch <nils@openssl.org>2006-03-13 23:14:57 +0000
committerNils Larsch <nils@openssl.org>2006-03-13 23:14:57 +0000
commit47d556664695f6bbde0d0ab0c1261ed0070c81fd (patch)
treeef4e7c5c8e408fd774538a45826c340ee3b8480a /crypto/ec/ecp_smpl.c
parent90bdfd97a68ed56d926a44b3d37f51b2450f5bb7 (diff)
downloadopenssl-47d556664695f6bbde0d0ab0c1261ed0070c81fd.tar.gz
fix error found by coverity: check if ctx is != NULL before calling BN_CTX_end()
Diffstat (limited to 'crypto/ec/ecp_smpl.c')
-rw-r--r--crypto/ec/ecp_smpl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/ec/ecp_smpl.c b/crypto/ec/ecp_smpl.c
index 75296a3673..4d26f8bdf6 100644
--- a/crypto/ec/ecp_smpl.c
+++ b/crypto/ec/ecp_smpl.c
@@ -336,7 +336,8 @@ int ec_GFp_simple_group_check_discriminant(const EC_GROUP *group, BN_CTX *ctx)
ret = 1;
err:
- BN_CTX_end(ctx);
+ if (ctx != NULL)
+ BN_CTX_end(ctx);
if (new_ctx != NULL)
BN_CTX_free(new_ctx);
return ret;