summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn
diff options
context:
space:
mode:
authormiod <>2014-05-22 21:12:16 +0000
committermiod <>2014-05-22 21:12:16 +0000
commitc34fac2dfaf2da90889ed845a5139c916868eea2 (patch)
treefd278ca4aaae51bbb11f6b3d67d862d9827370bc /src/lib/libcrypto/bn
parent5f35ad01d525b3834ce610866244a942ee37c441 (diff)
downloadopenbsd-c34fac2dfaf2da90889ed845a5139c916868eea2.tar.gz
openbsd-c34fac2dfaf2da90889ed845a5139c916868eea2.tar.bz2
openbsd-c34fac2dfaf2da90889ed845a5139c916868eea2.zip
if (x) free(x) -> free(x); semantic patch generated with coccinelle, carefully
eyeballed before applying. Contributed by Cyril Roelandt on tech@
Diffstat (limited to 'src/lib/libcrypto/bn')
-rw-r--r--src/lib/libcrypto/bn/bn_exp.c3
-rw-r--r--src/lib/libcrypto/bn/bn_gf2m.c15
2 files changed, 6 insertions, 12 deletions
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c
index 0e36e8d7b5..5d9263e01e 100644
--- a/src/lib/libcrypto/bn/bn_exp.c
+++ b/src/lib/libcrypto/bn/bn_exp.c
@@ -840,8 +840,7 @@ err:
840 BN_MONT_CTX_free(mont); 840 BN_MONT_CTX_free(mont);
841 if (powerbuf != NULL) { 841 if (powerbuf != NULL) {
842 OPENSSL_cleanse(powerbuf, powerbufLen); 842 OPENSSL_cleanse(powerbuf, powerbufLen);
843 if (powerbufFree) 843 free(powerbufFree);
844 free(powerbufFree);
845 } 844 }
846 BN_CTX_end(ctx); 845 BN_CTX_end(ctx);
847 return (ret); 846 return (ret);
diff --git a/src/lib/libcrypto/bn/bn_gf2m.c b/src/lib/libcrypto/bn/bn_gf2m.c
index 669f8c403e..4000fb8733 100644
--- a/src/lib/libcrypto/bn/bn_gf2m.c
+++ b/src/lib/libcrypto/bn/bn_gf2m.c
@@ -558,8 +558,7 @@ BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *p,
558 bn_check_top(r); 558 bn_check_top(r);
559 559
560err: 560err:
561 if (arr) 561 free(arr);
562 free(arr);
563 return ret; 562 return ret;
564} 563}
565 564
@@ -621,8 +620,7 @@ BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
621 bn_check_top(r); 620 bn_check_top(r);
622 621
623err: 622err:
624 if (arr) 623 free(arr);
625 free(arr);
626 return ret; 624 return ret;
627} 625}
628 626
@@ -1050,8 +1048,7 @@ BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *p,
1050 bn_check_top(r); 1048 bn_check_top(r);
1051 1049
1052err: 1050err:
1053 if (arr) 1051 free(arr);
1054 free(arr);
1055 return ret; 1052 return ret;
1056} 1053}
1057 1054
@@ -1113,8 +1110,7 @@ BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
1113 bn_check_top(r); 1110 bn_check_top(r);
1114 1111
1115err: 1112err:
1116 if (arr) 1113 free(arr);
1117 free(arr);
1118 return ret; 1114 return ret;
1119} 1115}
1120 1116
@@ -1249,8 +1245,7 @@ BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
1249 bn_check_top(r); 1245 bn_check_top(r);
1250 1246
1251err: 1247err:
1252 if (arr) 1248 free(arr);
1253 free(arr);
1254 return ret; 1249 return ret;
1255} 1250}
1256 1251