aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-cal-shell-backend.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-30 05:08:37 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:08:33 +0800
commit19307b54bc826cebbdea8cd7e1cdd8499bc1076f (patch)
tree4ac607b111a61163647ee777339fc5d1b490b4f0 /modules/calendar/e-cal-shell-backend.c
parenta624e7b4836cf810a528ea422e9961b2babf88fc (diff)
downloadgsoc2013-evolution-19307b54bc826cebbdea8cd7e1cdd8499bc1076f.tar
gsoc2013-evolution-19307b54bc826cebbdea8cd7e1cdd8499bc1076f.tar.gz
gsoc2013-evolution-19307b54bc826cebbdea8cd7e1cdd8499bc1076f.tar.bz2
gsoc2013-evolution-19307b54bc826cebbdea8cd7e1cdd8499bc1076f.tar.lz
gsoc2013-evolution-19307b54bc826cebbdea8cd7e1cdd8499bc1076f.tar.xz
gsoc2013-evolution-19307b54bc826cebbdea8cd7e1cdd8499bc1076f.tar.zst
gsoc2013-evolution-19307b54bc826cebbdea8cd7e1cdd8499bc1076f.zip
Add a bit more error checking and do not leak icalcomponent-s
Diffstat (limited to 'modules/calendar/e-cal-shell-backend.c')
-rw-r--r--modules/calendar/e-cal-shell-backend.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c
index 8d0c6ef36a..4b2692e420 100644
--- a/modules/calendar/e-cal-shell-backend.c
+++ b/modules/calendar/e-cal-shell-backend.c
@@ -624,10 +624,14 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
}
comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomp);
+ if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
+ g_debug ("%s: Failed to set icalcomp to comp\n", G_STRFUNC);
+ icalcomponent_free (icalcomp);
+ icalcomp = NULL;
+ }
- icalprop = icalcomponent_get_first_property (
- icalcomp, ICAL_ATTENDEE_PROPERTY);
+ icalprop = icalcomp ? icalcomponent_get_first_property (
+ icalcomp, ICAL_ATTENDEE_PROPERTY) : NULL;
if (icalprop != NULL)
flags |= COMP_EDITOR_MEETING;