]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rlm_radius: Free packets before retransmission
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 11 Apr 2020 05:11:14 +0000 (00:11 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 11 Apr 2020 05:11:14 +0000 (00:11 -0500)
src/modules/rlm_radius/rlm_radius_udp.c

index fdc5d04e46edfe0af0af2693c6cba39d66ada4e9..27f493253797479e3523eac08134d65067dda5c1 100644 (file)
@@ -300,7 +300,11 @@ static void udp_request_reset(udp_request_t *u)
        TALLOC_FREE(u->packet);
        u->extra = NULL;        /* Freed with packet */
 
-       radius_track_entry_release(&u->rr);
+       /*
+        *      Can have packet put no u->rr
+        *      if this is part of a pre-trunk status check.
+        */
+       if (u->rr) radius_track_entry_release(&u->rr);
        u->can_retransmit = false;
 }
 
@@ -634,6 +638,7 @@ static void conn_writable_status_check(fr_event_list_t *el, UNUSED int fd, UNUSE
         *      So increment the ID here.
         */
        } else {
+               udp_request_reset(u);
                u->id++;
        }
 
@@ -1717,7 +1722,8 @@ static void request_mux(fr_event_list_t *el,
                 *
                 *      Note that if we can't retransmit the previous
                 *      packet, then u->rr MUST already have been
-                *      deleted in the request_cancel() function, when
+                *      deleted in the request_cancel() function
+                *      or request_release_conn() function when
                 *      the REQUEUE signal was recevied.
                 */
                if (!u->packet || !u->can_retransmit) {