diff options
author | Rich Salz <rsalz@openssl.org> | 2015-03-28 10:54:15 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-03-28 10:54:15 -0400 |
commit | c5ba2d990420e1778ca4a90bf882e0f806404af0 (patch) | |
tree | 61641d19bea624b7fa523162f0ebb0d5e2fccf55 /crypto/cms/cms_env.c | |
parent | 33b188a8e82df57208ec8263c263f8b6f47e8255 (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/cms/cms_env.c')
-rw-r--r-- | crypto/cms/cms_env.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crypto/cms/cms_env.c b/crypto/cms/cms_env.c index d1252f8d87..3b4b930136 100644 --- a/crypto/cms/cms_env.c +++ b/crypto/cms/cms_env.c @@ -279,8 +279,7 @@ CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, err: if (ri) M_ASN1_free_of(ri, CMS_RecipientInfo); - if (pk) - EVP_PKEY_free(pk); + EVP_PKEY_free(pk); return NULL; } @@ -476,10 +475,8 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentInfo *cms, ec->keylen = eklen; err: - if (ktri->pctx) { - EVP_PKEY_CTX_free(ktri->pctx); - ktri->pctx = NULL; - } + EVP_PKEY_CTX_free(ktri->pctx); + ktri->pctx = NULL; if (!ret && ek) OPENSSL_free(ek); |