Commit 2d172503 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Fix memory leak if setup fails.



Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
(cherry picked from commit 891eac46)

Conflicts:
	crypto/cms/cms_enc.c
parent aa701624
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
    ok = 1;

 err:
    if (ec->key && !keep_key) {
    if (ec->key && (!keep_key || !ok)) {
        OPENSSL_cleanse(ec->key, ec->keylen);
        OPENSSL_free(ec->key);
        ec->key = NULL;