mirror of https://github.com/openssl/openssl.git
Minor code cleanup in o_names_init
This might result in a small memory leak.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17238)
(cherry picked from commit c50bf14450)
This commit is contained in:
parent
93838762b4
commit
907b966981
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue