From 6661a614864940611f36b41be39400e0d1ef506b Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 19 Jun 2023 16:10:45 +0200 Subject: [PATCH] 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") --- sched.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sched.c b/sched.c index 1505dc3..676866e 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);