From 279c59353ae5960365df198c435e3125d713ef29 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 11 Sep 2026 11:37:05 -0400 Subject: [PATCH] MT#55283 lightweight created_from Change-Id: Ie29312a0318e4e746ee4d88632442590b5a3f1f8 --- daemon/call.c | 1 + daemon/call_interfaces.c | 2 +- daemon/janus.c | 2 +- daemon/redis.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index ecabce121..cfb506447 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -5527,6 +5527,7 @@ static void __call_free(call_t *c) { } memory_arena_free_lw(c->callid.s); + memory_arena_free_lw(c->created_from.s); memory_arena = NULL; arena_free(&c->buffer); diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 6e4d500d6..0ae8f8c27 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -151,7 +151,7 @@ fail: static void updated_created_from(call_t *c, const char *addr) { if (!c->created_from.len && addr) - c->created_from = call_str_cpy_c(addr); + c->created_from = memory_arena_str_cpy_c_lw(addr); } static str call_update_lookup_udp(char **out, enum ng_opmode opmode, const char* addr) { diff --git a/daemon/janus.c b/daemon/janus.c index cc823296d..2b80a72a3 100644 --- a/daemon/janus.c +++ b/daemon/janus.c @@ -237,7 +237,7 @@ static const char *janus_videoroom_create(struct janus_session *session, struct continue; } if (!call->created_from.len) - call->created_from = STR_CONST("janus"); + call->created_from = memory_arena_str_cpy_c_lw("janus"); t_hash_table_insert(janus_rooms, &room->id, room); rwlock_unlock_w(&call->master_lock); obj_put(call); diff --git a/daemon/redis.c b/daemon/redis.c index 86afcb828..52d84a6dc 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -2335,7 +2335,7 @@ static void json_restore_call(struct redis *r, const str *callid, bool foreign) redis_hash_get_time_t(&c->deleted_us, &call, "deleted"); redis_hash_get_time_t(&c->ml_deleted_us, &call, "ml_deleted"); if (!redis_hash_get_str(&id, &call, "created_from")) - c->created_from = call_str_cpy(&id); + memory_arena_str_cpy_free(&c->created_from, &id); if (!redis_hash_get_int(&i, &call, "block_dtmf")) c->block_dtmf = i; if (!redis_hash_get_a64(&a64, &call, "call_flags"))