]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
better cleanups for connections
authorAlan T. DeKok <aland@freeradius.org>
Sat, 21 Oct 2017 12:38:25 +0000 (08:38 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 21 Oct 2017 12:48:22 +0000 (08:48 -0400)
src/modules/rlm_radius/rlm_radius_udp.c

index ecac4be8759afe58ae28cc1dbfb987cbefa9fbe7..808fc63cd98792558180f31abb709c0d089b0ec2 100644 (file)
@@ -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);