summaryrefslogtreecommitdiffstats
path: root/crypto/cms/cms_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/cms/cms_lib.c')
-rw-r--r--crypto/cms/cms_lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c
index a339f471e8..7e2010bff7 100644
--- a/crypto/cms/cms_lib.c
+++ b/crypto/cms/cms_lib.c
@@ -74,6 +74,10 @@ CMS_ContentInfo *CMS_ContentInfo_new(void)
void CMS_ContentInfo_free(CMS_ContentInfo *cms)
{
if (cms != NULL) {
+ CMS_EncryptedContentInfo *ec = ossl_cms_get0_env_enc_content(cms);
+
+ if (ec != NULL)
+ OPENSSL_clear_free(ec->key, ec->keylen);
OPENSSL_free(cms->ctx.propq);
ASN1_item_free((ASN1_VALUE *)cms, ASN1_ITEM_rptr(CMS_ContentInfo));
}