[evolution-data-server] Fix two calendar-related memory leaks
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Fix two calendar-related memory leaks
- Date: Thu, 24 Apr 2014 10:22:35 +0000 (UTC)
commit 5d6bf89f60dd2cf04387b01bc66dad6665bd082e
Author: Milan Crha <mcrha redhat com>
Date: Thu Apr 24 12:21:46 2014 +0200
Fix two calendar-related memory leaks
calendar/libecal/e-cal-client.c | 2 ++
calendar/libecal/e-cal-component.c | 10 ++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/calendar/libecal/e-cal-client.c b/calendar/libecal/e-cal-client.c
index ecc6ee9..39335ce 100644
--- a/calendar/libecal/e-cal-client.c
+++ b/calendar/libecal/e-cal-client.c
@@ -4077,6 +4077,8 @@ e_cal_client_get_object_list_sync (ECalClient *client,
*out_icalcomps = g_slist_reverse (tmp);
+ g_strfreev (strv);
+
return TRUE;
}
diff --git a/calendar/libecal/e-cal-component.c b/calendar/libecal/e-cal-component.c
index 8d7a6b1..bb9931f 100644
--- a/calendar/libecal/e-cal-component.c
+++ b/calendar/libecal/e-cal-component.c
@@ -4463,16 +4463,19 @@ set_alarm_description_cb (gpointer key,
SetAlarmDescriptionData *sadd;
gboolean changed = FALSE;
const gchar *old_summary = NULL;
+ gboolean free_description = FALSE;
alarm = value;
sadd = user_data;
/* set the new description on the alarm */
desc_prop = icalcomponent_get_first_property (alarm, ICAL_DESCRIPTION_PROPERTY);
- if (desc_prop)
+ if (desc_prop) {
old_summary = icalproperty_get_description (desc_prop);
- else
+ } else {
desc_prop = icalproperty_new_description (sadd->new_summary);
+ free_description = TRUE;
+ }
/* remove the X-EVOLUTION-NEEDS_DESCRIPTION property */
icalprop = icalcomponent_get_first_property (alarm, ICAL_X_PROPERTY);
@@ -4497,6 +4500,9 @@ set_alarm_description_cb (gpointer key,
icalproperty_set_description (desc_prop, sadd->new_summary);
}
}
+
+ if (free_description)
+ icalproperty_free (desc_prop);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]