From: Alan T. DeKok Date: Sat, 11 Jan 2025 13:40:05 +0000 (-0500) Subject: no need for destructor X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e25e8d7bd380157be076b45d57d4306222720bb;p=thirdparty%2Ffreeradius-server.git no need for destructor alive clients are talloc'd from the thread, so freeing the thread will free the clients --- diff --git a/src/lib/io/master.c b/src/lib/io/master.c index b19441b0979..eb1eba935de 100644 --- a/src/lib/io/master.c +++ b/src/lib/io/master.c @@ -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. */