Commit b7d2480c authored by Alex Gaynor's avatar Alex Gaynor Committed by Rich Salz
Browse files

GH1537: Avoid double-free in the EVP_PKEY API



Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
(cherry picked from commit d65c3615)
parent e9590d00
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -398,6 +398,7 @@ void EVP_PKEY_free(EVP_PKEY *x)
        return;
    REF_ASSERT_ISNT(i < 0);
    EVP_PKEY_free_it(x);
    CRYPTO_THREAD_lock_free(x->lock);
    sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
    OPENSSL_free(x);
}
@@ -413,7 +414,6 @@ static void EVP_PKEY_free_it(EVP_PKEY *x)
    ENGINE_finish(x->engine);
    x->engine = NULL;
#endif
    CRYPTO_THREAD_lock_free(x->lock);
}

static int unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent,