From 0fd4e548372df9988c7446a1fe4b4f29962eb8d0 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 11 Sep 2026 10:10:17 -0400 Subject: [PATCH] MT#55283 lightweight rec meta Change-Id: Ieb802e45f0e231ad1815676d1fd4229fb0a523be --- daemon/recording.c | 7 +++++-- daemon/redis.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/daemon/recording.c b/daemon/recording.c index f4ada4240..0fc5ab15b 100644 --- a/daemon/recording.c +++ b/daemon/recording.c @@ -374,8 +374,8 @@ void recording_start_daemon(call_t *call) { char rand_str[rand_bytes * 2 + 1]; rand_hex_str(rand_str, rand_bytes); g_autoptr(char) meta_prefix = g_strdup_printf("%s-%s", escaped_callid, rand_str); - call->recording_meta_prefix = call_str_cpy(STR_PTR(meta_prefix)); - call->recording_random_tag = call_str_cpy(&STR_CONST(rand_str)); + call->recording_meta_prefix = memory_arena_str_cpy_lw(STR_PTR(meta_prefix)); + call->recording_random_tag = memory_arena_str_cpy_lw(&STR_CONST(rand_str)); } _rm(init_struct, call); @@ -858,7 +858,10 @@ void recording_finish(call_t *call, bool discard) { // clear the meta prefix to ensure that pcaps for subsequent // start recordings dont overwrite previous ones + memory_arena_free_lw(call->recording_meta_prefix.s); call->recording_meta_prefix = STR_NULL; + memory_arena_free_lw(call->recording_random_tag.s); + call->recording_random_tag = STR_NULL; // also clear per-recording path overrides so they are not // inadvertently reused if the next start recording omits them call->recording_file = STR_NULL; diff --git a/daemon/redis.c b/daemon/redis.c index 88be89ed5..326a8decc 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -2385,7 +2385,7 @@ static void json_restore_call(struct redis *r, const str *callid, bool foreign) // presence of this key determines whether we were recording at all if (!redis_hash_get_str(&s, &call, "recording_meta_prefix")) { - c->recording_meta_prefix = call_str_cpy(&s); + memory_arena_str_cpy_free(&c->recording_meta_prefix, &s); // coverity[check_return : FALSE] redis_hash_get_str(&s, &call, "recording_metadata"); c->metadata = call_str_cpy(&s);