From 5e7d0337f62c3292ca470623fbe07677fa88a32b Mon Sep 17 00:00:00 2001 From: ron Date: Thu, 10 Feb 2022 19:26:53 +0800 Subject: [PATCH] lib: wheel's typo fix The wheel data structure is a array of list pointers but the alloc for it is using the sizeof (struct listnode *) as the amount to allocate. Even though the (struct listnode *) and (struct list *) sizes are the same, let's list the correct values. Signed-off-by: ron --- lib/wheel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wheel.c b/lib/wheel.c index cdf738a137..6e9c88de9d 100644 --- a/lib/wheel.c +++ b/lib/wheel.c @@ -94,7 +94,7 @@ struct timer_wheel *wheel_init(struct thread_master *master, int period, wheel->nexttime = period / slots; wheel->wheel_slot_lists = XCALLOC(MTYPE_TIMER_WHEEL_LIST, - slots * sizeof(struct listnode *)); + slots * sizeof(struct list *)); for (i = 0; i < slots; i++) wheel->wheel_slot_lists[i] = list_new();