aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-task-list-selector.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-30 05:08:37 +0800
committerMilan Crha <mcrha@redhat.com>2011-06-30 05:08:37 +0800
commit87c04cfc2ccd7ffea028ee4e1d7a7e5d554ca056 (patch)
treeeeb8a4dc20cccdda68aeb5fff0274e44511bde8f /calendar/gui/e-task-list-selector.c
parenta6c6699511d9fdf96bb36e5ff4cf7c91c0ca07f7 (diff)
downloadgsoc2013-evolution-87c04cfc2ccd7ffea028ee4e1d7a7e5d554ca056.tar.gz
gsoc2013-evolution-87c04cfc2ccd7ffea028ee4e1d7a7e5d554ca056.tar.zst
gsoc2013-evolution-87c04cfc2ccd7ffea028ee4e1d7a7e5d554ca056.zip
Add a bit more error checking and do not leak icalcomponent-s
Diffstat (limited to 'calendar/gui/e-task-list-selector.c')
-rw-r--r--calendar/gui/e-task-list-selector.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/calendar/gui/e-task-list-selector.c b/calendar/gui/e-task-list-selector.c
index 9d1fb5cb99..ff4e187877 100644
--- a/calendar/gui/e-task-list-selector.c
+++ b/calendar/gui/e-task-list-selector.c
@@ -45,9 +45,11 @@ task_list_selector_update_single_object (ECalClient *client,
uid = (gchar *) icalcomponent_get_uid (icalcomp);
- if (e_cal_client_get_object_sync (client, uid, NULL, &tmp_icalcomp, NULL, NULL))
- return e_cal_client_modify_object_sync (
- client, icalcomp, CALOBJ_MOD_ALL, NULL, NULL);
+ if (e_cal_client_get_object_sync (client, uid, NULL, &tmp_icalcomp, NULL, NULL)) {
+ icalcomponent_free (tmp_icalcomp);
+
+ return e_cal_client_modify_object_sync (client, icalcomp, CALOBJ_MOD_ALL, NULL, NULL);
+ }
if (!e_cal_client_create_object_sync (client, icalcomp, &uid, NULL, NULL))
return FALSE;