From: Alan T. DeKok Date: Wed, 2 Aug 2017 15:00:29 +0000 (+0200) Subject: parent events off of id, not request X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe3d549e2301cfdf7c15aa8a771714e831c2d0da;p=thirdparty%2Ffreeradius-server.git parent events off of id, not request because when we're freeing the request, the event will be removed before rr, and rr points to the event. Instead, rely on the rlm_radius_link_t to free up the things properly. --- diff --git a/src/modules/rlm_radius/track.c b/src/modules/rlm_radius/track.c index a5547075f85..4818f1d2a0e 100644 --- a/src/modules/rlm_radius/track.c +++ b/src/modules/rlm_radius/track.c @@ -226,7 +226,10 @@ int rr_track_delete(rlm_radius_id_t *id, rlm_radius_request_t *rr) (void) talloc_get_type_abort(id, rlm_radius_id_t); rr->request = NULL; - if (rr->ev) talloc_const_free(rr->ev); + if (rr->ev) { + talloc_const_free(rr->ev); + rr->ev = NULL; + } rad_assert(id->num_requests > 0); id->num_requests--; @@ -452,7 +455,7 @@ int rr_track_retry(UNUSED rlm_radius_id_t *id, rlm_radius_request_t *rr, fr_even next.tv_sec += (next.tv_usec / USEC); next.tv_usec %= USEC; - if (fr_event_timer_insert(rr->request, el, &rr->ev, &next, callback, uctx) < 0) { + if (fr_event_timer_insert(id, el, &rr->ev, &next, callback, uctx) < 0) { return -1; } @@ -473,7 +476,7 @@ int rr_track_start(UNUSED rlm_radius_id_t *id, rlm_radius_request_t *rr, fr_even next.tv_sec += (next.tv_usec / USEC); next.tv_usec %= USEC; - if (fr_event_timer_insert(rr->request, el, &rr->ev, &next, callback, uctx) < 0) { + if (fr_event_timer_insert(id, el, &rr->ev, &next, callback, uctx) < 0) { return -1; }