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
pull/2147/head
Donat Zenichev 3 weeks ago
parent 7970be92e2
commit f1a35b9a04

@ -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) {

Loading…
Cancel
Save