]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Do more talloc checks on timer chunks
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 27 Mar 2025 19:14:47 +0000 (13:14 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 28 Mar 2025 04:19:00 +0000 (22:19 -0600)
src/lib/util/timer.c

index d13ad7939ab0c998750c557f5c1793a2156d05a4..f7e2349a58ddb18735a43ad76be28f8f3a7c2963 100644 (file)
@@ -402,7 +402,7 @@ int _fr_timer_at(NDEBUG_LOCATION_ARGS
 
                talloc_set_destructor(ev, _timer_free);
        } else {
-               ev = UNCONST(fr_timer_t *, *ev_p);
+               ev = talloc_get_type_abort(UNCONST(fr_timer_t *, *ev_p), fr_timer_t);
 
                EVENT_DEBUG("%p - " NDEBUG_LOCATION_FMT "Re-armed timer %p", tl, NDEBUG_LOCATION_VALS ev);
 
@@ -701,7 +701,7 @@ static int timer_list_lst_run(fr_timer_list_t *tl, fr_time_t *when)
        int             fired = 0;
 
        while (fr_lst_num_elements(tl->lst) > 0) {
-               ev = fr_lst_peek(tl->lst);
+               ev = talloc_get_type_abort(fr_lst_peek(tl->lst), fr_timer_t);
 
                /*
                 *      See if it's time to do this one.
@@ -760,6 +760,8 @@ static int timer_list_ordered_run(fr_timer_list_t *tl, fr_time_t *when)
        unsigned int    fired = 0;
 
        while ((ev = timer_head(&tl->ordered))) {
+               (void)talloc_get_type_abort(ev, fr_timer_t);
+
                /*
                 *      See if it's time to do this one.
                 */