提交 39571fca 编写于 作者: D Dr. Matthias St. Pierre 提交者: Benjamin Kaduk

Fix memory leak in do_rand_drbg_init()

Fixes #5076

Since do_rand_drbg_init() allocates three locks, it needs to ensure
that OPENSSL_init_crypto() is called, otherwise these resources are
not cleaned up properly.
Reviewed-by: NMatt Caswell <matt@openssl.org>
Reviewed-by: NBen Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/5083)
上级 d17bdfc2
......@@ -708,6 +708,13 @@ err:
*/
DEFINE_RUN_ONCE_STATIC(do_rand_drbg_init)
{
/*
* ensure that libcrypto is initialized, otherwise the
* DRBG locks are not cleaned up properly
*/
if (!OPENSSL_init_crypto(0, NULL))
return 0;
drbg_master = drbg_setup("drbg_master", NULL);
drbg_public = drbg_setup("drbg_public", drbg_master);
drbg_private = drbg_setup("drbg_private", drbg_master);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册