From 80099bd57c35fd92dc17e65c0541eba0b0f9aa62 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 29 Apr 2021 12:10:30 -0400 Subject: [PATCH] TT#111150 fix mem leak in codec tracker Change-Id: Ie1a617c7ab82147dfce7973d927843f55906a1a5 --- daemon/codec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/codec.c b/daemon/codec.c index d08906594..eabcc692a 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -3586,8 +3586,9 @@ void codec_tracker_finish(struct call_media *media, struct call_media *other_med // finally check which clock rates are left over and remove those GList *to_remove = g_hash_table_get_keys(supp_clockrates); - for (GList *k = to_remove; k; k = k->next) { - unsigned int clockrate = GPOINTER_TO_UINT(k->data); + while (to_remove) { + unsigned int clockrate = GPOINTER_TO_UINT(to_remove->data); + to_remove = g_list_delete_link(to_remove, to_remove); // ignore if we haven't touched anything with that clock rate if (!sct->all_touched && !g_hash_table_lookup(sct->touched, GUINT_TO_POINTER(clockrate)))