mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 05:25:07 -05:00
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: 6ea1082a72 ("sched: free timer blocks on exit")
This commit is contained in:
2
sched.c
2
sched.c
@@ -163,6 +163,8 @@ SCH_Finalise(void) {
|
|||||||
|
|
||||||
ARR_DestroyInstance(file_handlers);
|
ARR_DestroyInstance(file_handlers);
|
||||||
|
|
||||||
|
timer_queue.next = &timer_queue;
|
||||||
|
timer_queue.prev = &timer_queue;
|
||||||
for (i = 0; i < ARR_GetSize(tqe_blocks); i++)
|
for (i = 0; i < ARR_GetSize(tqe_blocks); i++)
|
||||||
Free(*(TimerQueueEntry **)ARR_GetElement(tqe_blocks, i));
|
Free(*(TimerQueueEntry **)ARR_GetElement(tqe_blocks, i));
|
||||||
ARR_DestroyInstance(tqe_blocks);
|
ARR_DestroyInstance(tqe_blocks);
|
||||||
|
|||||||
Reference in New Issue
Block a user