]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/calendar/serv_calendar.c
* free the ical struct after using it.
[citadel.git] / citadel / modules / calendar / serv_calendar.c
index a8ae3b7c9e8a7c5f47527837b7fc33e483558f9c..c97a4e82a63652092a96eaa4cb2dd23075614479 100644 (file)
@@ -114,6 +114,7 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
        char *ser = NULL;
        icalcomponent *encaps = NULL;
        struct CtdlMessage *msg = NULL;
+       icalcomponent *tmp=NULL;
 
        if (cal == NULL) return;
 
@@ -121,8 +122,10 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
         * a full VCALENDAR component, and save that instead.
         */
        if (icalcomponent_isa(cal) != ICAL_VCALENDAR_COMPONENT) {
-               encaps = ical_encapsulate_subcomponent(icalcomponent_new_clone(cal));
+               tmp = icalcomponent_new_clone(cal);
+               encaps = ical_encapsulate_subcomponent(tmp);
                ical_write_to_cal(u, encaps);
+               icalcomponent_free(tmp);
                icalcomponent_free(encaps);
                return;
        }
@@ -173,7 +176,7 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
        }
 
        /* In either case, now we can free the serialized calendar object */
-       free(ser);
+//     free(ser);
 }