From 7193b99f7ae278d58bc06c0322d8c12eddaf2df6 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Thu, 26 Jul 2007 12:37:57 +0000 Subject: Plugged memory leaks. 2007-07-26 Hiroyuki Ikezoe * gui/alarm-notify/config-data.c, gui/tasks-component.c, gui/calendar-component.c, gui/memos-component.c: Plugged memory leaks. svn path=/trunk/; revision=33852 --- calendar/gui/alarm-notify/config-data.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'calendar/gui/alarm-notify') diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c index 28b3730e9e..9ddac9f3c1 100644 --- a/calendar/gui/alarm-notify/config-data.c +++ b/calendar/gui/alarm-notify/config-data.c @@ -111,8 +111,11 @@ config_data_get_calendars (const char *key) NULL); cal_sources = e_source_list_new_for_gconf (conf_client, key); - if (cal_sources && g_slist_length (gconf_list)) + if (cal_sources && g_slist_length (gconf_list)) { + g_slist_foreach (gconf_list, (GFunc) g_free, NULL); + g_slist_free (gconf_list); return cal_sources; + } state = gconf_client_get_bool (conf_client, "/apps/evolution/calendar/notify/notify_with_tray", @@ -133,8 +136,17 @@ config_data_get_calendars (const char *key) source, NULL); cal_sources = e_source_list_new_for_gconf (conf_client, key); + + if (source) { + g_slist_foreach (source, (GFunc) g_free, NULL); + g_slist_free (source); + } + } + + if (gconf_list) { + g_slist_foreach (gconf_list, (GFunc) g_free, NULL); + g_slist_free (gconf_list); } - return cal_sources; @@ -171,6 +183,11 @@ config_data_replace_string_list (const char *key, break; } } + + if (source) { + g_slist_foreach (source, (GFunc) g_free, NULL); + g_slist_free (source); + } } GConfClient * -- cgit v1.2.3