[gnome-calendar] utils: fix memory leak
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] utils: fix memory leak
- Date: Fri, 26 Dec 2014 15:13:12 +0000 (UTC)
commit 43dd2e207f189a461afa4fedc1da08daaf9b5af8
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Thu Dec 25 18:47:32 2014 -0500
utils: fix memory leak
src/gcal-utils.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/gcal-utils.c b/src/gcal-utils.c
index 17aef99..78ee3d2 100644
--- a/src/gcal-utils.c
+++ b/src/gcal-utils.c
@@ -428,26 +428,26 @@ build_component_from_details (const gchar *summary,
ECalComponentDateTime dt;
ECalComponentText summ;
- icaltimetype *dt_start;
event = e_cal_component_new ();
e_cal_component_set_new_vtype (event, E_CAL_COMPONENT_EVENT);
- dt_start = gcal_dup_icaltime (initial_date);
- dt.value = dt_start;
+ dt.value = (icaltimetype*) initial_date;
dt.tzid = NULL;
e_cal_component_set_dtstart (event, &dt);
if (final_date != NULL)
{
- *dt.value = *final_date;
+ dt.value = (icaltimetype*) final_date;
e_cal_component_set_dtend (event, &dt);
}
else
{
- icaltime_adjust (dt_start, 1, 0, 0, 0);
- *dt.value = *dt_start;
+ icaltimetype *dt_end = gcal_dup_icaltime (initial_date);
+ icaltime_adjust (dt_end, 1, 0, 0, 0);
+ dt.value = dt_end;
e_cal_component_set_dtend (event, &dt);
+ g_free (dt_end);
}
summ.altrep = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]