[evolution-data-server/evolution-data-server-3-12] Fix two calendar-related memory leaks
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/evolution-data-server-3-12] Fix two calendar-related memory leaks
- Date: Thu, 24 Apr 2014 10:26:04 +0000 (UTC)
commit febad18e9cd005cfa79fcc9e76045f415cd202b6
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 8ab422c..bd69ec1 100644
--- a/calendar/libecal/e-cal-client.c
+++ b/calendar/libecal/e-cal-client.c
@@ -4078,6 +4078,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 ce4ad59..2480cad 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]