summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorSteven Valdez <svaldez@google.com>2016-03-01 13:20:43 -0500
committerDr. Stephen Henson <steve@openssl.org>2016-05-11 18:51:13 +0100
commit48bacd31e88421fa413f0a62ef8e0285e3dbd402 (patch)
tree4e01a6e20554dbd08097ca647feb93d0acd4e81c /crypto/ec
parenta6eec3574e220fe83b95be048106ed3add80942a (diff)
Adding missing BN_CTX_(start/end) in crypto/ec/ec_key.c
RT#4363 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org> (cherry picked from commit 2ab851b779a77d119e1677b2495b368a46d83eef) Conflicts: crypto/ec/ec_key.c
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ec_key.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c
index bc94ab5661..456080ecfe 100644
--- a/crypto/ec/ec_key.c
+++ b/crypto/ec/ec_key.c
@@ -377,9 +377,9 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
return 0;
}
ctx = BN_CTX_new();
- if (!ctx)
- goto err;
-
+ if (ctx == NULL)
+ return 0;
+ BN_CTX_start(ctx);
point = EC_POINT_new(key->group);
if (!point)
@@ -432,10 +432,9 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
ok = 1;
err:
- if (ctx)
- BN_CTX_free(ctx);
- if (point)
- EC_POINT_free(point);
+ BN_CTX_end(ctx);
+ BN_CTX_free(ctx);
+ EC_POINT_free(point);
return ok;
}