diff options
-rw-r--r-- | crypto/cms/cms_enc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/cms/cms_enc.c b/crypto/cms/cms_enc.c index f9556acc2e..16b42251d1 100644 --- a/crypto/cms/cms_enc.c +++ b/crypto/cms/cms_enc.c @@ -194,7 +194,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) ok = 1; err: - if (!keep_key) { + if (!keep_key || !ok) { OPENSSL_clear_free(ec->key, ec->keylen); ec->key = NULL; } |