Thread: Avoid a NULL dereference after failed initialisation.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10493)
This commit is contained in:
Pauli 2019-11-21 13:15:21 +10:00
parent acc7b9fb5c
commit 3478a2102e

View File

@ -380,6 +380,8 @@ static int init_thread_deregister(void *index, int all)
int i;
gtr = get_global_tevent_register();
if (gtr == NULL)
return 0;
if (!all)
CRYPTO_THREAD_write_lock(gtr->lock);
for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {