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/dh/dh_ameth.c | 3 +-- src/lib/libcrypto/dh/dh_pmeth.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/lib/libcrypto/dh') diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c index a22614ae0a..40e0202bff 100644 --- a/src/lib/libcrypto/dh/dh_ameth.c +++ b/src/lib/libcrypto/dh/dh_ameth.c @@ -167,8 +167,7 @@ static int dh_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) return 1; err: - if (penc) - free(penc); + free(penc); if (pval) ASN1_STRING_free(pval); diff --git a/src/lib/libcrypto/dh/dh_pmeth.c b/src/lib/libcrypto/dh/dh_pmeth.c index c359bb4d2b..c70feb3789 100644 --- a/src/lib/libcrypto/dh/dh_pmeth.c +++ b/src/lib/libcrypto/dh/dh_pmeth.c @@ -110,8 +110,7 @@ static int pkey_dh_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) static void pkey_dh_cleanup(EVP_PKEY_CTX *ctx) { DH_PKEY_CTX *dctx = ctx->data; - if (dctx) - free(dctx); + free(dctx); } static int pkey_dh_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) -- cgit v1.2.3-55-g6feb