From 56e97cb4066ed4e87dc00a65ff6e41f36bfefded Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 18 Aug 2009 09:21:27 -0500 Subject: [PATCH] Refactor ECC: Free the new_en_list Avoid a potential memory leak in case the interface is removed during the SIM read operation. --- src/voicecall.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/voicecall.c b/src/voicecall.c index c88e672..f6939d5 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -514,6 +514,12 @@ static void voicecalls_destroy(gpointer userdata) calls->en_list = NULL; } + if (calls->new_en_list) { + g_slist_foreach(calls->new_en_list, (GFunc)g_free, NULL); + g_slist_free(calls->new_en_list); + calls->new_en_list = NULL; + } + for (l = calls->call_list; l; l = l->next) voicecall_dbus_unregister(modem, l->data); -- 2.7.4