summaryrefslogtreecommitdiffstats
path: root/crypto/evp/pmeth_lib.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-03-28 10:54:15 -0400
committerRich Salz <rsalz@openssl.org>2015-03-28 10:54:15 -0400
commitc5ba2d990420e1778ca4a90bf882e0f806404af0 (patch)
tree61641d19bea624b7fa523162f0ebb0d5e2fccf55 /crypto/evp/pmeth_lib.c
parent33b188a8e82df57208ec8263c263f8b6f47e8255 (diff)
free NULL cleanup
EVP_.*free; this gets: EVP_CIPHER_CTX_free EVP_PKEY_CTX_free EVP_PKEY_asn1_free EVP_PKEY_asn1_set_free EVP_PKEY_free EVP_PKEY_free_it EVP_PKEY_meth_free; and also EVP_CIPHER_CTX_cleanup Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'crypto/evp/pmeth_lib.c')
-rw-r--r--crypto/evp/pmeth_lib.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c
index 9183e405ea..b20a902ef7 100644
--- a/crypto/evp/pmeth_lib.c
+++ b/crypto/evp/pmeth_lib.c
@@ -363,10 +363,8 @@ void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx)
return;
if (ctx->pmeth && ctx->pmeth->cleanup)
ctx->pmeth->cleanup(ctx);
- if (ctx->pkey)
- EVP_PKEY_free(ctx->pkey);
- if (ctx->peerkey)
- EVP_PKEY_free(ctx->peerkey);
+ EVP_PKEY_free(ctx->pkey);
+ EVP_PKEY_free(ctx->peerkey);
#ifndef OPENSSL_NO_ENGINE
if (ctx->engine)
/*