]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use fr_dlist_talloc_free() instead of hand-rolled loop
authorAlan T. DeKok <aland@freeradius.org>
Thu, 5 Mar 2026 12:05:08 +0000 (07:05 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 5 Mar 2026 12:05:08 +0000 (07:05 -0500)
src/lib/server/trunk.c

index 522e50379eddb6b3176cae04a5f29e3a5fe953bd..37187bfb17231ec53d5fb876085590c6c1f12428 100644 (file)
@@ -4243,11 +4243,7 @@ static void trunk_manage(trunk_t *trunk, fr_time_t now)
        /*
         *      Process deferred connection freeing
         */
-       if (!trunk->in_handler) {
-               while ((tconn = fr_dlist_pop_head(&trunk->to_free)) != NULL) {
-                       talloc_free(tconn);
-               }
-       }
+       if (!trunk->in_handler) fr_dlist_talloc_free(&trunk->to_free);
 
        /*
         *      Update the state of the trunk
@@ -4921,7 +4917,7 @@ static int _trunk_free(trunk_t *trunk)
        /*
         *      Process any deferred connection frees
         */
-       while ((tconn = fr_dlist_head(&trunk->to_free))) talloc_free(fr_dlist_remove(&trunk->to_free, tconn));
+       fr_dlist_talloc_free(&trunk->to_free);
 
        /*
         *      Free any requests left in the backlog