From: Alan T. DeKok Date: Sat, 21 Oct 2017 12:38:25 +0000 (-0400) Subject: better cleanups for connections X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=116a63d23abd78242acff7de7af37d9422b1a88a;p=thirdparty%2Ffreeradius-server.git better cleanups for connections --- diff --git a/src/modules/rlm_radius/rlm_radius_udp.c b/src/modules/rlm_radius/rlm_radius_udp.c index ecac4be8759..808fc63cd98 100644 --- a/src/modules/rlm_radius/rlm_radius_udp.c +++ b/src/modules/rlm_radius/rlm_radius_udp.c @@ -2187,8 +2187,6 @@ static int _conn_free(rlm_radius_udp_connection_t *c) talloc_free(c->conn); c->conn = NULL; - talloc_free_children(c); /* clears out FD events, timers, etc. */ - /* * Move "sent" packets back to the main thread queue */ @@ -2201,6 +2199,13 @@ static int _conn_free(rlm_radius_udp_connection_t *c) state_transition(u, PACKET_STATE_THREAD); } + if (c->status_u) talloc_free(c->status_u); + + if (c->zombie_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); + + talloc_free_children(c); /* clears out FD events, timers, etc. */ + switch (c->state) { default: rad_assert(0 == 1);