[openssl] openssl-3.0 update

bernd.edlinger at hotmail.de bernd.edlinger at hotmail.de
Thu Dec 9 18:25:42 UTC 2021


The branch openssl-3.0 has been updated
       via  907b966981a1d6f1e1fcbf0ab752e040a49f1475 (commit)
      from  93838762b406efe3aad9c807a0fd1f48e6efe3ab (commit)


- Log -----------------------------------------------------------------
commit 907b966981a1d6f1e1fcbf0ab752e040a49f1475
Author: Bernd Edlinger <bernd.edlinger at hotmail.de>
Date:   Wed Dec 8 14:14:48 2021 +0100

    Minor code cleanup in o_names_init
    
    This might result in a small memory leak.
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17238)
    
    (cherry picked from commit c50bf14450f3cd242f2211ca7e500191053d8050)

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

Summary of changes:
 crypto/objects/o_names.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/crypto/objects/o_names.c b/crypto/objects/o_names.c
index 05aa8c44aa..92152eeb66 100644
--- a/crypto/objects/o_names.c
+++ b/crypto/objects/o_names.c
@@ -66,8 +66,14 @@ static int obj_name_cmp(const OBJ_NAME *a, const OBJ_NAME *b);
 static CRYPTO_ONCE init = CRYPTO_ONCE_STATIC_INIT;
 DEFINE_RUN_ONCE_STATIC(o_names_init)
 {
-    names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
+    names_lh = NULL;
     obj_lock = CRYPTO_THREAD_lock_new();
+    if (obj_lock != NULL)
+        names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
+    if (names_lh == NULL) {
+        CRYPTO_THREAD_lock_free(obj_lock);
+        obj_lock = NULL;
+    }
     return names_lh != NULL && obj_lock != NULL;
 }
 


More information about the openssl-commits mailing list