diff options
author | Milan Crha <mcrha@redhat.com> | 2011-06-30 05:08:37 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-09-14 20:08:33 +0800 |
commit | 19307b54bc826cebbdea8cd7e1cdd8499bc1076f (patch) | |
tree | 4ac607b111a61163647ee777339fc5d1b490b4f0 /calendar/gui/e-memo-list-selector.c | |
parent | a624e7b4836cf810a528ea422e9961b2babf88fc (diff) | |
download | gsoc2013-evolution-19307b54bc826cebbdea8cd7e1cdd8499bc1076f.tar.gz gsoc2013-evolution-19307b54bc826cebbdea8cd7e1cdd8499bc1076f.tar.zst gsoc2013-evolution-19307b54bc826cebbdea8cd7e1cdd8499bc1076f.zip |
Add a bit more error checking and do not leak icalcomponent-s
Diffstat (limited to 'calendar/gui/e-memo-list-selector.c')
-rw-r--r-- | calendar/gui/e-memo-list-selector.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/calendar/gui/e-memo-list-selector.c b/calendar/gui/e-memo-list-selector.c index abc4bf9bf3..cbcd0025e1 100644 --- a/calendar/gui/e-memo-list-selector.c +++ b/calendar/gui/e-memo-list-selector.c @@ -45,9 +45,11 @@ memo_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; |