]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
no need for destructor
authorAlan T. DeKok <aland@freeradius.org>
Sat, 11 Jan 2025 13:40:05 +0000 (08:40 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 11 Jan 2025 13:40:05 +0000 (08:40 -0500)
alive clients are talloc'd from the thread, so freeing the thread
will free the clients

src/lib/io/master.c

index b19441b0979278ed1da7c39b237aa9222cc1a8de..eb1eba935de5e8c7d861e6efa12aeb8ab4eacffc 100644 (file)
@@ -2897,27 +2897,6 @@ fr_trie_t *fr_master_io_network(TALLOC_CTX *ctx, int af, fr_ipaddr_t *allow, fr_
 }
 
 
-static int _thread_io_free(fr_io_thread_t *thread)
-{
-       fr_io_client_t *client;
-
-       /*
-        *      Each client is it's own talloc context, so we have to
-        *      clean them up individually.
-        *
-        *      The client destructor will remove them from the heap,
-        *      so we don't need to do that here.
-        *
-        *      Note that the clients *also* use thread->trie, so we
-        *      have to free the clients *before* freeing thread->trie.
-        */
-       while ((client = fr_heap_peek(thread->alive_clients)) != NULL) {
-               talloc_free(client);
-       }
-
-       return 0;
-}
-
 int fr_io_listen_free(fr_listen_t *li)
 {
        if (!li->thread_instance) return 0;
@@ -2982,8 +2961,6 @@ int fr_master_io_listen(fr_io_instance_t *inst, fr_schedule_t *sc,
        thread->listen = li;
        thread->sc = sc;
 
-       talloc_set_destructor(thread, _thread_io_free);
-
        /*
         *      Create the trie of clients for this socket.
         */