提交 d65c3615 编写于 作者: A Alex Gaynor 提交者: Rich Salz

GH1537: Avoid double-free in the EVP_PKEY API

Reviewed-by: NMatt Caswell <matt@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 01c09f9f
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册