From f1a35b9a04ee636395d4864d79924f60a91a5fc1 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Mon, 20 Jul 2026 22:20:11 +0200 Subject: [PATCH] MT#61856 recording: local cleanup hardening The `finish_proc()` misses part of the clean-up work if the kernel table isn't open. Only `kernel_del_call()` really depends on the `kernel.is_open`, local cleanup should still happen. Change-Id: I8f999dbc48f7dd04b4ca1ba5edbc9218a3c49d29 --- daemon/recording.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/daemon/recording.c b/daemon/recording.c index 6adbb837b..f05964a2d 100644 --- a/daemon/recording.c +++ b/daemon/recording.c @@ -1000,17 +1000,21 @@ static void sdp_after_proc(struct recording *recording, const str *sdp, struct c static void finish_proc(call_t *call, bool discard) { struct recording *recording = call->recording; - if (!kernel.is_open) - return; - if (recording->proc.call_idx != UNINIT_IDX) { + + if (kernel.is_open && recording->proc.call_idx != UNINIT_IDX) kernel_del_call(recording->proc.call_idx); - recording->proc.call_idx = UNINIT_IDX; - } + + recording->proc.call_idx = UNINIT_IDX; + for (__auto_type l = call->streams.head; l; l = l->next) { struct packet_stream *ps = l->data; ps->recording.proc.stream_idx = UNINIT_IDX; } + if (!recording->proc.meta_filepath) + return; + + /* rename / unlink / free */ const char *unlink_fn = recording->proc.meta_filepath; g_autoptr(char) discard_fn = NULL; if (discard) {