[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Matt Caswell matt at openssl.org
Thu Sep 8 11:45:18 UTC 2016


The branch OpenSSL_1_1_0-stable has been updated
       via  ea42bd40595faefb19e2ec8d7a9efad4f75cff80 (commit)
      from  baee63371d568a2439cd1dddf584bcdf19b7cbbc (commit)


- Log -----------------------------------------------------------------
commit ea42bd40595faefb19e2ec8d7a9efad4f75cff80
Author: Matt Caswell <matt at openssl.org>
Date:   Mon Sep 5 14:12:58 2016 +0100

    Fix mem leaks during auto-deinit
    
    Certain functions are automatically called during auto-deinit in order
    to deallocate resources. However, if we have never entered a function which
    marks lib crypto as inited then they never get called. This can happen if
    the user only ever makes use of a small sub-set of functions that don't hit
    the auto-init code.
    
    This commit ensures all such resources deallocated by these functions also
    init libcrypto when they are initially allocated.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Ben Laurie <ben at openssl.org>
    (cherry picked from commit 135648bcd0e9db029582d3d7627a90a1b566c5d6)

-----------------------------------------------------------------------

Summary of changes:
 crypto/bio/b_addr.c     | 1 +
 crypto/engine/eng_lib.c | 1 +
 crypto/err/err.c        | 1 +
 crypto/ex_data.c        | 1 +
 crypto/rand/md_rand.c   | 1 +
 5 files changed, 5 insertions(+)

diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
index f924e10..29f92cf 100644
--- a/crypto/bio/b_addr.c
+++ b/crypto/bio/b_addr.c
@@ -604,6 +604,7 @@ static int addrinfo_wrap(int family, int socktype,
 
 DEFINE_RUN_ONCE_STATIC(do_bio_lookup_init)
 {
+    OPENSSL_init_crypto(0, NULL);
     bio_lookup_lock = CRYPTO_THREAD_lock_new();
     return bio_lookup_lock != NULL;
 }
diff --git a/crypto/engine/eng_lib.c b/crypto/engine/eng_lib.c
index 67d755a..28de21d 100644
--- a/crypto/engine/eng_lib.c
+++ b/crypto/engine/eng_lib.c
@@ -18,6 +18,7 @@ CRYPTO_ONCE engine_lock_init = CRYPTO_ONCE_STATIC_INIT;
 
 DEFINE_RUN_ONCE(do_engine_lock_init)
 {
+    OPENSSL_init_crypto(0, NULL);
     global_engine_lock = CRYPTO_THREAD_lock_new();
     return global_engine_lock != NULL;
 }
diff --git a/crypto/err/err.c b/crypto/err/err.c
index 584bb9e..c3f7212 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -251,6 +251,7 @@ static void ERR_STATE_free(ERR_STATE *s)
 
 DEFINE_RUN_ONCE_STATIC(do_err_strings_init)
 {
+    OPENSSL_init_crypto(0, NULL);
     err_string_lock = CRYPTO_THREAD_lock_new();
     return err_string_lock != NULL;
 }
diff --git a/crypto/ex_data.c b/crypto/ex_data.c
index 986ef70..bb1af0b 100644
--- a/crypto/ex_data.c
+++ b/crypto/ex_data.c
@@ -38,6 +38,7 @@ static CRYPTO_ONCE ex_data_init = CRYPTO_ONCE_STATIC_INIT;
 
 DEFINE_RUN_ONCE_STATIC(do_ex_data_init)
 {
+    OPENSSL_init_crypto(0, NULL);
     ex_data_lock = CRYPTO_THREAD_lock_new();
     return ex_data_lock != NULL;
 }
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index 7924478..85ce4e6 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -89,6 +89,7 @@ static RAND_METHOD rand_meth = {
 
 DEFINE_RUN_ONCE_STATIC(do_rand_lock_init)
 {
+    OPENSSL_init_crypto(0, NULL);
     rand_lock = CRYPTO_THREAD_lock_new();
     rand_tmp_lock = CRYPTO_THREAD_lock_new();
     return rand_lock != NULL && rand_tmp_lock != NULL;


More information about the openssl-commits mailing list