From 5dace62b01176b22d2901ebdbfba6e07c93fa8b4 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 13 Jan 2024 22:04:16 -0500 Subject: [PATCH] updated description --- citadel/server/modules/calendar/serv_calendar.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/citadel/server/modules/calendar/serv_calendar.c b/citadel/server/modules/calendar/serv_calendar.c index 4d8605827..b8eaaa6ca 100644 --- a/citadel/server/modules/calendar/serv_calendar.c +++ b/citadel/server/modules/calendar/serv_calendar.c @@ -1490,26 +1490,23 @@ void ical_getics_backend(long msgnum, void *data) { if (ird.cal == NULL) return; - // Here we go: put the VEVENT into the VCALENDAR. We now no longer - // are responsible for "the_request"'s memory -- it will be freed - // when we free "encaps". + // Here we go: put the VEVENT componment into the VCALENDAR container. - // If the top-level component is *not* a VCALENDAR, we can drop it right in. - // This will almost never happen. + // If the top-level component is *not* a VCALENDAR container, we can drop it right in. + // This is rare but we have to be able to handle it. if (icalcomponent_isa(ird.cal) != ICAL_VCALENDAR_COMPONENT) { icalcomponent_add_component(encaps, ird.cal); + // And now, the parent VCALENDAR container owns the child component's memory. } - // In the more likely event that we're looking at a VCALENDAR with the VEVENT - // and other components encapsulated inside, we have to extract them. + // In the more likely event that we're looking at a VCALENDAR container with the VEVENT + // and other components encapsulated inside, we have to extract them first. else { for (c = icalcomponent_get_first_component(ird.cal, ICAL_ANY_COMPONENT); (c != NULL); c = icalcomponent_get_next_component(ird.cal, ICAL_ANY_COMPONENT) ) { - // For VTIMEZONE components, suppress duplicates of the same tzid - if (icalcomponent_isa(c) == ICAL_VTIMEZONE_COMPONENT) { icalproperty *p = icalcomponent_get_first_property(c, ICAL_TZID_PROPERTY); if (p) { @@ -1525,7 +1522,7 @@ void ical_getics_backend(long msgnum, void *data) { icalcomponent_add_component(encaps, icalcomponent_new_clone(c)); } } - icalcomponent_free(ird.cal); + icalcomponent_free(ird.cal); // we cloned this component so free the original. } } -- 2.30.2