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/comp-util.c | |
parent | a624e7b4836cf810a528ea422e9961b2babf88fc (diff) | |
download | gsoc2013-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 'calendar/gui/comp-util.c')
-rw-r--r-- | calendar/gui/comp-util.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index a6095d0bcc..d44914fb46 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -722,7 +722,12 @@ comp_util_sanitize_recurrence_master (ECalComponent *comp, } master = e_cal_component_new (); - e_cal_component_set_icalcomponent (master, icalcomp); + if (!e_cal_component_set_icalcomponent (master, icalcomp)) { + icalcomponent_free (icalcomp); + g_object_unref (master); + g_return_if_reached (); + return; + } /* Compare recur id and start date */ e_cal_component_get_recurid (comp, &rid); @@ -739,6 +744,10 @@ comp_util_sanitize_recurrence_master (ECalComponent *comp, e_cal_component_get_dtend (comp, &edt); + g_return_if_fail (msdt.value != NULL); + g_return_if_fail (medt.value != NULL); + g_return_if_fail (edt.value != NULL); + sdt.value->year = msdt.value->year; sdt.value->month = msdt.value->month; sdt.value->day = msdt.value->day; |