]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
parent events off of id, not request
authorAlan T. DeKok <aland@freeradius.org>
Wed, 2 Aug 2017 15:00:29 +0000 (17:00 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 2 Aug 2017 15:06:33 +0000 (17:06 +0200)
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.

src/modules/rlm_radius/track.c

index a5547075f852635748004fefa9dadd39f074eb05..4818f1d2a0e4cb9cbf4927aab8c543986d8f6402 100644 (file)
@@ -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;
        }