mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
GH1537: Avoid double-free in the EVP_PKEY API
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
01c09f9fde
commit
d65c3615f6
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user