From: Alan T. DeKok Date: Tue, 3 Oct 2017 20:10:03 +0000 (-0400) Subject: only call timer delete if we have a timer X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90b8fa0e98deb7cbe81bf45026fc82bd9953b7c8;p=thirdparty%2Ffreeradius-server.git only call timer delete if we have a timer --- diff --git a/src/modules/rlm_radius/rlm_radius_udp.c b/src/modules/rlm_radius/rlm_radius_udp.c index 3e15a091eb2..4735a914ca8 100644 --- a/src/modules/rlm_radius/rlm_radius_udp.c +++ b/src/modules/rlm_radius/rlm_radius_udp.c @@ -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;