]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
timer events are parented from the event list
authorAlan T. DeKok <aland@freeradius.org>
Tue, 31 Oct 2017 20:05:02 +0000 (16:05 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 31 Oct 2017 20:05:02 +0000 (16:05 -0400)
so delete them manually, before calling talloc_free_children(),
otherwise we will try to access children that no longer exist...

src/lib/util/event.c

index abaa89402932430df8abd59d2ab4989bb7233028..887a50ba2300876e83f55812ced3826c3b1c87fb 100644 (file)
@@ -1764,12 +1764,12 @@ static int _event_list_free(fr_event_list_t *el)
 {
        fr_event_timer_t const *ev;
 
-       talloc_free_children(el);
-
        while ((ev = fr_heap_peek(el->times)) != NULL) fr_event_timer_delete(el, &ev);
 
        talloc_free(el->times);
 
+       talloc_free_children(el);
+
        close(el->kq);
 
        return 0;