summaryrefslogtreecommitdiffstats
path: root/src/cbs.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-09-15 14:35:09 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-09-16 04:53:41 -0500
commitb83c7acfc9b0e5f8e2ed77435326a1dcb55dfe0c (patch)
treeeb1cd47ecfcd427933243d4435ed6ae3e32ea4ae /src/cbs.c
parenta34849599bd7a14674f29c9d13e66780a8ac4097 (diff)
downloadofono-b83c7acfc9b0e5f8e2ed77435326a1dcb55dfe0c.tar.bz2
Fix: do not leak memory, cleanup the topic list
Diffstat (limited to 'src/cbs.c')
-rw-r--r--src/cbs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cbs.c b/src/cbs.c
index 10ba5b26..efc8d3f0 100644
--- a/src/cbs.c
+++ b/src/cbs.c
@@ -420,6 +420,18 @@ static void cbs_unregister(struct ofono_atom *atom)
g_dbus_unregister_interface(conn, path, CBS_MANAGER_INTERFACE);
ofono_modem_remove_interface(modem, CBS_MANAGER_INTERFACE);
+ if (cbs->topics) {
+ g_slist_foreach(cbs->topics, (GFunc)g_free, NULL);
+ g_slist_free(cbs->topics);
+ cbs->topics = NULL;
+ }
+
+ if (cbs->new_topics) {
+ g_slist_foreach(cbs->new_topics, (GFunc)g_free, NULL);
+ g_slist_free(cbs->new_topics);
+ cbs->new_topics = NULL;
+ }
+
if (cbs->sim_watch) {
if (cbs->imsi_watch) {
ofono_sim_remove_ready_watch(cbs->sim,