diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 14:37:16 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 14:37:16 -0400 |
commit | 25aaa98aa249d26391c1994d2de449562c8b8b99 (patch) | |
tree | 6f83efd87fa9fd832e8a456e9686143a29f1dab3 /engines | |
parent | 666964780a245c14e8f0eb6e13dd854a37387ea9 (diff) |
free NULL cleanup -- coda
After the finale, the "real" final part. :) Do a recursive grep with
"-B1 -w [a-zA-Z0-9_]*_free" to see if any of the preceeding lines are
an "if NULL" check that can be removed.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'engines')
-rw-r--r-- | engines/ccgost/gost2001.c | 10 | ||||
-rw-r--r-- | engines/ccgost/gost2001_keyx.c | 3 |
2 files changed, 6 insertions, 7 deletions
diff --git a/engines/ccgost/gost2001.c b/engines/ccgost/gost2001.c index 5490a5d760..8b56a30471 100644 --- a/engines/ccgost/gost2001.c +++ b/engines/ccgost/gost2001.c @@ -109,8 +109,8 @@ int fill_GOST2001_params(EC_KEY *eckey, int nid) } ok = 1; err: - if (P) EC_POINT_free(P); - if (grp) EC_GROUP_free(grp); + EC_POINT_free(P); + EC_GROUP_free(grp); if (ctx) BN_CTX_end(ctx); BN_CTX_free(ctx); @@ -243,7 +243,7 @@ DSA_SIG *gost2001_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey) if (ctx) BN_CTX_end(ctx); BN_CTX_free(ctx); - if (C) EC_POINT_free(C); + EC_POINT_free(C); BN_free(md); if (!ret) DSA_SIG_free(newsig); @@ -361,7 +361,7 @@ int gost2001_do_verify(const unsigned char *dgst, int dgst_len, ok = 1; } err: - if (C) EC_POINT_free(C); + EC_POINT_free(C); if (ctx) BN_CTX_end(ctx); BN_CTX_free(ctx); @@ -413,7 +413,7 @@ int gost2001_compute_public(EC_KEY *ec) } ok = 256; err: - if (pub_key) EC_POINT_free(pub_key); + EC_POINT_free(pub_key); if (ctx) BN_CTX_end(ctx); BN_CTX_free(ctx); diff --git a/engines/ccgost/gost2001_keyx.c b/engines/ccgost/gost2001_keyx.c index 864d01bfa0..abbacbb40f 100644 --- a/engines/ccgost/gost2001_keyx.c +++ b/engines/ccgost/gost2001_keyx.c @@ -285,7 +285,6 @@ int pkey_GOST01cp_decrypt(EVP_PKEY_CTX *pctx, unsigned char *key, ret = 1; err: EVP_PKEY_free(eph_key); - if (gkt) - GOST_KEY_TRANSPORT_free(gkt); + GOST_KEY_TRANSPORT_free(gkt); return ret; } |