From: Miroslav Lichvar Date: Mon, 19 Jun 2023 14:10:45 +0000 (+0200) Subject: sched: reset timer queue in finalization X-Git-Tag: 4.4-pre2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6661a614864940611f36b41be39400e0d1ef506b;p=thirdparty%2Fchrony.git sched: reset timer queue in finalization Don't leave dangling pointers to timer queue entries when they are freed in the scheduler finalization in case some code tried to remove a timer later. Fixes: 6ea1082a72d8 ("sched: free timer blocks on exit") --- diff --git a/sched.c b/sched.c index 1505dc3a..676866ef 100644 --- a/sched.c +++ b/sched.c @@ -163,6 +163,8 @@ SCH_Finalise(void) { ARR_DestroyInstance(file_handlers); + timer_queue.next = &timer_queue; + timer_queue.prev = &timer_queue; for (i = 0; i < ARR_GetSize(tqe_blocks); i++) Free(*(TimerQueueEntry **)ARR_GetElement(tqe_blocks, i)); ARR_DestroyInstance(tqe_blocks);