* fix memleak while updating tasks
authorWilfried Göesgens <willi@citadel.org>
Sun, 8 Feb 2009 16:58:58 +0000 (16:58 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 8 Feb 2009 16:58:58 +0000 (16:58 +0000)
webcit/calendar.c

index d97750bbb76ee59694ad4f9ba229bd4dc592e122..30e4e5280c0cfa80dfac6323cbe64291f6a37b6e 100644 (file)
@@ -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);