From: Wilfried Göesgens Date: Sun, 8 Feb 2009 16:58:58 +0000 (+0000) Subject: * fix memleak while updating tasks X-Git-Tag: v7.86~1480 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=888bb798184266dd1e9799d9082e3f2485775fa1;p=citadel.git * fix memleak while updating tasks --- diff --git a/webcit/calendar.c b/webcit/calendar.c index d97750bbb..30e4e5280 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -842,8 +842,12 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum, char* from icalcomponent_remove_property(vtodo,prop); icalproperty_free(prop); } - icalcomponent_remove_property(vtodo, - icalcomponent_get_first_property(vtodo, ICAL_PERCENTCOMPLETE_PROPERTY)); + while(prop = icalcomponent_get_first_property(vtodo, + ICAL_PERCENTCOMPLETE_PROPERTY), prop != NULL) { + icalcomponent_remove_property(vtodo,prop); + icalproperty_free(prop); + } + if (havebstr("status")) { icalproperty_status taskStatus = icalproperty_string_to_status(bstr("status")); icalcomponent_set_status(vtodo, taskStatus);