The branch master has been updated
via 39571fcabf688a6efc4a567f6a8e5d4297b064cb (commit)
from d17bdfc26d87097c2c80854fd521b6ecebdf5ebb (commit)
- Log -----------------------------------------------------------------
commit 39571fcabf688a6efc4a567f6a8e5d4297b064cb
Author: Dr. Matthias St. Pierre <[email protected]>
Date: Tue Jan 16 08:03:37 2018 +0100
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: Matt Caswell <[email protected]>
Reviewed-by: Ben Kaduk <[email protected]>
(Merged from https://github.com/openssl/openssl/pull/5083)
-----------------------------------------------------------------------
Summary of changes:
crypto/rand/drbg_lib.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/crypto/rand/drbg_lib.c b/crypto/rand/drbg_lib.c
index ff7f654..5d3d0f2 100644
--- a/crypto/rand/drbg_lib.c
+++ b/crypto/rand/drbg_lib.c
@@ -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);
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits