From 579097e812469b33d623a650304538d7e194d70b Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 10 Sep 2026 13:26:35 -0400 Subject: [PATCH] MT#55283 g_new for last user of uid_alloc Change-Id: I33188c74a1da8daa5372e410602e8021426ca9df --- daemon/media_socket.c | 11 ++++++----- lib/helpers.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/daemon/media_socket.c b/daemon/media_socket.c index 5143b7400..db5898291 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -4178,11 +4178,6 @@ void play_buffered(struct jb_packet *cp) { void interfaces_free(void) { struct local_intf *ifc; - while ((ifc = i_queue_pop_head(&all_local_interfaces))) { - free(ifc->ice_foundation.s); - bufferpool_unref(ifc->stats); - } - t_hash_table_destroy(__logical_intf_name_family_hash); __auto_type l_iter = t_hash_table_iter(__local_intf_addr_type_hash); @@ -4225,6 +4220,12 @@ void interfaces_free(void) { } } + while ((ifc = i_queue_pop_head(&all_local_interfaces))) { + free(ifc->ice_foundation.s); + bufferpool_unref(ifc->stats); + g_free(ifc); + } + t_hash_table_destroy_ptr(&local_media_socket_endpoints); } diff --git a/lib/helpers.h b/lib/helpers.h index 538569cbc..2d0014679 100644 --- a/lib/helpers.h +++ b/lib/helpers.h @@ -258,7 +258,7 @@ void thread_create_looper(enum thread_looper_action (*f)(void), const char *sche /*** ALLOC WITH UNIQUE ID HELPERS ***/ #define uid_alloc(q) ({ \ - __typeof__((q)->__t) __ret = memory_arena_alloc0_lw(__typeof__(*(q)->__t)); \ + __typeof__((q)->__t) __ret = g_new0(__typeof__(*(q)->__t), 1); \ __ret->unique_id = (q)->length; \ t_queue_push_tail(q, __ret); \ __ret; \