Fix coverity CID - NULL ptr dereference in initthread.c
@@ -392,13 +392,14 @@ static int init_thread_deregister(void *index, int all)
for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
THREAD_EVENT_HANDLER **hands
= sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
- THREAD_EVENT_HANDLER *curr = *hands, *prev = NULL, *tmp;
+ THREAD_EVENT_HANDLER *curr = NULL, *prev = NULL, *tmp;
if (hands == NULL) {
if (!all)
CRYPTO_THREAD_unlock(gtr->lock);
return 0;
}
+ curr = *hands;
while (curr != NULL) {
if (all || curr->index == index) {
if (prev != NULL)
