** Fixes bug #420933
authorMatthew Barnes <mbarnes@redhat.com>
Sun, 25 Mar 2007 18:50:54 +0000 (18:50 +0000)
committerMatthew Barnes <mbarnes@src.gnome.org>
Sun, 25 Mar 2007 18:50:54 +0000 (18:50 +0000)
2007-03-25  Matthew Barnes  <mbarnes@redhat.com>

** Fixes bug #420933

* libecal/e-cal.c (e_cal_generate_instances_for_object):
Copy the recurrence ID string so it doesn't disappear on us.
Patch from Patrick Ohly.

svn path=/trunk/; revision=7664

calendar/ChangeLog
calendar/libecal/e-cal.c

index b3bdee7..f9809ba 100644 (file)
@@ -1,3 +1,11 @@
+2007-03-25  Matthew Barnes  <mbarnes@redhat.com>
+
+       ** Fixes bug #420933
+
+       * libecal/e-cal.c (e_cal_generate_instances_for_object):
+       Copy the recurrence ID string so it doesn't disappear on us.
+       Patch from Patrick Ohly.
+
 2007-03-16  Matthew Barnes  <mbarnes@redhat.com>
 
        ** Fixes part of bug #360240
index f506084..3f6998f 100644 (file)
@@ -3875,7 +3875,8 @@ e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp,
 {
        ECalPrivate *priv;
        ECalComponent *comp;
-       const char *uid, *rid;
+       const char *uid;
+       char *rid;
        gboolean result;
        GList *instances = NULL;
        ECalComponentDateTime datetime;
@@ -3904,7 +3905,8 @@ e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp,
        }
                
        e_cal_component_get_uid (comp, &uid);
-       rid = e_cal_component_get_recurid_as_string (comp);
+       /* string might be freed at any time, keep a copy */
+       rid = g_strdup (e_cal_component_get_recurid_as_string (comp));
 
        /* Get the start timezone */
        e_cal_component_get_dtstart (comp, &datetime);
@@ -3946,6 +3948,7 @@ e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp,
        /* clean up */
        g_object_unref (comp);
        g_free (instances_hold);
+       g_free (rid);
 }
 
 /* Builds a list of ECalComponentAlarms structures */