Skip to content

Commit

Permalink
Merge pull request #11884 from mjstapp/fix_cancel_ptrs
Browse files Browse the repository at this point in the history
lib: ensure locals are inited to NULL
  • Loading branch information
ton31337 authored Sep 2, 2022
2 parents 4ed967b + 7e93a54 commit 1011b31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -1354,9 +1354,9 @@ static void do_thread_cancel(struct thread_master *master)
struct thread_list_head *list = NULL;
struct thread **thread_array = NULL;
struct thread *thread;

struct cancel_req *cr;
struct listnode *ln;

for (ALL_LIST_ELEMENTS_RO(master->cancel_req, ln, cr)) {
/*
* If this is an event object cancellation, search
Expand All @@ -1379,6 +1379,9 @@ static void do_thread_cancel(struct thread_master *master)
if (!thread)
continue;

list = NULL;
thread_array = NULL;

/* Determine the appropriate queue to cancel the thread from */
switch (thread->type) {
case THREAD_READ:
Expand Down

0 comments on commit 1011b31

Please sign in to comment.