From 866e049a6ca609c2b0dd95cfec88d102bf81e321 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 11 Sep 2026 10:52:21 -0400 Subject: [PATCH] MT#55283 lightweight tag Change-Id: I228cd0820c56fbf2fed8f5ec37cbfd0a47693bcc --- daemon/call.c | 9 +++++---- daemon/redis.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index a1491891c..be5e46eac 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -5459,7 +5459,7 @@ void __monologue_free(struct call_monologue *m) { g_string_free(m->last_out_sdp, TRUE); t_queue_clear_full(&m->generic_attributes, sdp_attr_free); t_queue_clear_full(&m->all_attributes, sdp_attr_free); - t_queue_clear(&m->tag_aliases); + t_queue_clear_full(&m->tag_aliases, memory_arena_str_dup_free_lw); t_queue_clear_full(&m->groups_other, memory_arena_str_dup_free_lw); sdp_orig_free(&m->sdp_orig_in); sdp_orig_free(&m->sdp_orig_out); @@ -5473,6 +5473,7 @@ void __monologue_free(struct call_monologue *m) { memory_arena_free_lw(m->moh_file.s); memory_arena_free_lw(m->label.s); memory_arena_free_lw(m->metadata.s); + memory_arena_free_lw(m->tag.s); memory_arena_free_lw(m); } @@ -5917,7 +5918,7 @@ void __monologue_tag(struct call_monologue *ml, const str *tag) { if (!ml->tag.s) { dbg_int("tagging monologue with '" STR_FORMAT "'", STR_FMT(tag)); - ml->tag = call_str_cpy(tag); + ml->tag = memory_arena_str_cpy_lw(tag); t_hash_table_insert(call->tags, &ml->tag, ml); return; } @@ -5931,12 +5932,12 @@ void __monologue_tag(struct call_monologue *ml, const str *tag) { // remove old entry first, as `ml->tag` will be changed t_hash_table_remove(call->tags, &ml->tag); // duplicate string and save as alias - str *old_tag = call_str_dup(&ml->tag); + str *old_tag = memory_arena_str_dup_lw(&ml->tag); t_queue_push_tail(&ml->tag_aliases, old_tag); // add duplicated old tag into hash table t_hash_table_insert(call->tags, old_tag, ml); // update tag to new one - ml->tag = call_str_cpy(tag); + memory_arena_str_cpy_free(&ml->tag, tag); // and add new one to hash table t_hash_table_insert(call->tags, &ml->tag, ml); } diff --git a/daemon/redis.c b/daemon/redis.c index 91f7bcd0a..6646295fe 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -1915,7 +1915,7 @@ static int rbl_subs_cb(str *s, callback_arg_t dummy, struct redis_list *list, vo static int cb_tag_aliases(str *s, callback_arg_t dummy, struct redis_list *list, void *ptr) { struct call_monologue *ml = ptr; - t_queue_push_tail(&ml->tag_aliases, call_str_dup(s)); + t_queue_push_tail(&ml->tag_aliases, memory_arena_str_dup_lw(s)); return 0; }