Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 8461)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,14 @@
+2008-02-06  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #509776
+
+	* libecal/e-cal-component.h: (ECalComponentAlarmInstance):
+	Structure owns auid point, so do not declare it as const.
+	* libecal/e-cal-component.c: (e_cal_component_alarms_free):
+	Free instance->auid too, do not leak now.
+	* libecal/e-cal-util.c: (add_trigger):
+	Store copy of the auid into instance, it owns it now.
+
 2008-02-05  Peteris Krisjanis <pecisk@gmail.com>
 
 	** Fix for bug #514487
Index: calendar/libecal/e-cal-component.c
===================================================================
--- calendar/libecal/e-cal-component.c	(revision 8461)
+++ calendar/libecal/e-cal-component.c	(working copy)
@@ -5291,6 +5291,7 @@
 
 		instance = l->data;
 		g_assert (instance != NULL);
+		g_free (instance->auid);
 		g_free (instance);
 	}
 
Index: calendar/libecal/e-cal-component.h
===================================================================
--- calendar/libecal/e-cal-component.h	(revision 8461)
+++ calendar/libecal/e-cal-component.h	(working copy)
@@ -364,7 +364,7 @@
 /* An alarm occurrence, i.e. a trigger instance */
 typedef struct {
 	/* UID of the alarm that triggered */
-	const char *auid;
+	char *auid;
 
 	/* Trigger time, i.e. "5 minutes before the appointment" */
 	time_t trigger;
Index: calendar/libecal/e-cal-util.c
===================================================================
--- calendar/libecal/e-cal-util.c	(revision 8461)
+++ calendar/libecal/e-cal-util.c	(working copy)
@@ -336,7 +336,7 @@
 	ECalComponentAlarmInstance *instance;
 
 	instance = g_new (ECalComponentAlarmInstance, 1);
-	instance->auid = auid;
+	instance->auid = g_strdup (auid);
 	instance->trigger = trigger;
 	instance->occur_start = occur_start;
 	instance->occur_end = occur_end;
