summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_mult.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ec_mult.c')
-rw-r--r--src/lib/libcrypto/ec/ec_mult.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/lib/libcrypto/ec/ec_mult.c b/src/lib/libcrypto/ec/ec_mult.c
index b6f74a1b09..4e49ce4f7b 100644
--- a/src/lib/libcrypto/ec/ec_mult.c
+++ b/src/lib/libcrypto/ec/ec_mult.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_mult.c,v 1.13 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: ec_mult.c,v 1.14 2014/07/12 16:03:37 miod Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. 3 * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -679,10 +679,8 @@ ec_wNAF_mul(const EC_GROUP * group, EC_POINT * r, const BIGNUM * scalar,
679 ret = 1; 679 ret = 1;
680 680
681err: 681err:
682 if (new_ctx != NULL) 682 BN_CTX_free(new_ctx);
683 BN_CTX_free(new_ctx); 683 EC_POINT_free(tmp);
684 if (tmp != NULL)
685 EC_POINT_free(tmp);
686 free(wsize); 684 free(wsize);
687 free(wNAF_len); 685 free(wNAF_len);
688 if (wNAF != NULL) { 686 if (wNAF != NULL) {
@@ -862,10 +860,8 @@ ec_wNAF_precompute_mult(EC_GROUP * group, BN_CTX * ctx)
862err: 860err:
863 if (ctx != NULL) 861 if (ctx != NULL)
864 BN_CTX_end(ctx); 862 BN_CTX_end(ctx);
865 if (new_ctx != NULL) 863 BN_CTX_free(new_ctx);
866 BN_CTX_free(new_ctx); 864 ec_pre_comp_free(pre_comp);
867 if (pre_comp)
868 ec_pre_comp_free(pre_comp);
869 if (points) { 865 if (points) {
870 EC_POINT **p; 866 EC_POINT **p;
871 867
@@ -873,10 +869,8 @@ err:
873 EC_POINT_free(*p); 869 EC_POINT_free(*p);
874 free(points); 870 free(points);
875 } 871 }
876 if (tmp_point) 872 EC_POINT_free(tmp_point);
877 EC_POINT_free(tmp_point); 873 EC_POINT_free(base);
878 if (base)
879 EC_POINT_free(base);
880 return ret; 874 return ret;
881} 875}
882 876