From 31181df3ca3b68e1419bc9a97e4aee92a5f91f73 Mon Sep 17 00:00:00 2001 From: miod <> Date: Thu, 22 May 2014 21:12:16 +0000 Subject: if (x) free(x) -> free(x); semantic patch generated with coccinelle, carefully eyeballed before applying. Contributed by Cyril Roelandt on tech@ --- src/lib/libcrypto/bn/bn_exp.c | 3 +-- src/lib/libcrypto/bn/bn_gf2m.c | 15 +++++---------- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'src/lib/libcrypto/bn') 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: BN_MONT_CTX_free(mont); if (powerbuf != NULL) { OPENSSL_cleanse(powerbuf, powerbufLen); - if (powerbufFree) - free(powerbufFree); + free(powerbufFree); } BN_CTX_end(ctx); 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, bn_check_top(r); err: - if (arr) - free(arr); + free(arr); return ret; } @@ -621,8 +620,7 @@ BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) bn_check_top(r); err: - if (arr) - free(arr); + free(arr); return ret; } @@ -1050,8 +1048,7 @@ BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *p, bn_check_top(r); err: - if (arr) - free(arr); + free(arr); return ret; } @@ -1113,8 +1110,7 @@ BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) bn_check_top(r); err: - if (arr) - free(arr); + free(arr); return ret; } @@ -1249,8 +1245,7 @@ BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) bn_check_top(r); err: - if (arr) - free(arr); + free(arr); return ret; } -- cgit v1.2.3-55-g6feb