diff options
author | Milan Crha <mcrha@redhat.com> | 2011-06-30 05:08:37 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-06-30 05:08:37 +0800 |
commit | 87c04cfc2ccd7ffea028ee4e1d7a7e5d554ca056 (patch) | |
tree | eeb8a4dc20cccdda68aeb5fff0274e44511bde8f /calendar/gui/comp-util.c | |
parent | a6c6699511d9fdf96bb36e5ff4cf7c91c0ca07f7 (diff) | |
download | gsoc2013-evolution-87c04cfc2ccd7ffea028ee4e1d7a7e5d554ca056.tar gsoc2013-evolution-87c04cfc2ccd7ffea028ee4e1d7a7e5d554ca056.tar.gz gsoc2013-evolution-87c04cfc2ccd7ffea028ee4e1d7a7e5d554ca056.tar.bz2 gsoc2013-evolution-87c04cfc2ccd7ffea028ee4e1d7a7e5d554ca056.tar.lz gsoc2013-evolution-87c04cfc2ccd7ffea028ee4e1d7a7e5d554ca056.tar.xz 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/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; |