]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
cms: fix memleaks in cms_env.c
authorzhaozg <zhaozg@gmail.com>
Tue, 24 Aug 2021 14:43:18 +0000 (22:43 +0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 27 Aug 2021 07:26:12 +0000 (09:26 +0200)
CLA: trivial

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16403)

(cherry picked from commit 58e1e397c6774be11b903c0f88e85bd2b8c4206f)

crypto/cms/cms_env.c

index 673880f6d9eaab35e35c2952d05b51ca94adcc1e..51a1d7df848c73360b811a30f34fcd3b68cd498f 100644 (file)
@@ -951,6 +951,7 @@ static int cms_RecipientInfo_kekri_decrypt(CMS_ContentInfo *cms,
     }
     ukeylen += outlen;
 
+    OPENSSL_clear_free(ec->key, ec->keylen);
     ec->key = ukey;
     ec->keylen = ukeylen;