]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: ensure locals are inited to NULL 11884/head
authorMark Stapp <mstapp@nvidia.com>
Wed, 31 Aug 2022 15:47:39 +0000 (11:47 -0400)
committerMark Stapp <mstapp@nvidia.com>
Wed, 31 Aug 2022 15:47:39 +0000 (11:47 -0400)
A couple of pointers in do_thread_cancel() we only inited at
the start of the function; make sure they're inited during
each iteration of the loop.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
lib/thread.c

index c3613b5b0e87b68314ec7cd460f51e705af06a5b..9eac9b410a4a76d08229b8761b6c9653da26bc4d 100644 (file)
@@ -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
@@ -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: