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/ec | |
parent | 90bdfd97a68ed56d926a44b3d37f51b2450f5bb7 (diff) |
fix error found by coverity: check if ctx is != NULL before calling BN_CTX_end()
Diffstat (limited to 'crypto/ec')
-rw-r--r-- | crypto/ec/ec2_smpl.c | 3 | ||||
-rw-r--r-- | crypto/ec/ec_check.c | 3 | ||||
-rw-r--r-- | crypto/ec/ecp_smpl.c | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/crypto/ec/ec2_smpl.c b/crypto/ec/ec2_smpl.c index a2eb64859f..527e6d8147 100644 --- a/crypto/ec/ec2_smpl.c +++ b/crypto/ec/ec2_smpl.c @@ -281,7 +281,8 @@ int ec_GF2m_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; diff --git a/crypto/ec/ec_check.c b/crypto/ec/ec_check.c index f22c5641a8..0e316b4b3f 100644 --- a/crypto/ec/ec_check.c +++ b/crypto/ec/ec_check.c @@ -113,7 +113,8 @@ int EC_GROUP_check(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); if (point) 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; |