]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
only call timer delete if we have a timer
authorAlan T. DeKok <aland@freeradius.org>
Tue, 3 Oct 2017 20:10:03 +0000 (16:10 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 3 Oct 2017 20:10:03 +0000 (16:10 -0400)
src/modules/rlm_radius/rlm_radius_udp.c

index 3e15a091eb273bb2992b914fb6d974d9b1c71b87..4735a914ca8ec307d9cb55f0ddb45815f48a76f9 100644 (file)
@@ -1661,8 +1661,8 @@ static fr_connection_state_t _conn_failed(int fd, fr_connection_state_t state, v
                /*
                 *      Delete all timers associated with the connection.
                 */
-               (void) fr_event_timer_delete(c->thread->el, &c->idle_ev);
-               (void) fr_event_timer_delete(c->thread->el, &c->zombie_ev);
+               if (c->idle_ev) (void) fr_event_timer_delete(c->thread->el, &c->idle_ev);
+               if (c->zombie_ev) (void) fr_event_timer_delete(c->thread->el, &c->zombie_ev);
 
                /*
                 *      Move "sent" packets back to the thread queue,
@@ -1944,7 +1944,7 @@ static int _conn_free(rlm_radius_udp_connection_t *c)
                 */
                u->rr = NULL;
                u->c = NULL;
-               (void) fr_event_timer_delete(c->thread->el, &u->timer.ev);
+               if (u->timer.ev) (void) fr_event_timer_delete(c->thread->el, &u->timer.ev);
                fr_dlist_remove(&u->entry);
                (void) fr_heap_insert(t->queued, u);
                t->pending = true;