From dfd95ba7b0c2180772b9217f886ed0481c2a20e6 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 22 Jul 2010 16:28:57 +0100 Subject: [PATCH] Free items on completion --- ews2ical.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ews2ical.c b/ews2ical.c index b46b2ac..68d1419 100644 --- a/ews2ical.c +++ b/ews2ical.c @@ -67,6 +67,7 @@ int main(int argc, char **argv) outbuf =icalcomponent_as_ical_string_r(calcomp); fprintf(calfile, "%s", outbuf); free(outbuf); + icalcomponent_free(calcomp); return 0; } @@ -74,6 +75,8 @@ icalcomponent *fetch_item(int xmlfd, const char *parent_id, icaltimezone *zone, { xmlDocPtr xml_doc; xmlNode *xml_node; + icalcomponent *comp; + char buf[1]; read(xmlfd, buf, 1); if (*buf == '<') @@ -153,7 +156,9 @@ icalcomponent *fetch_item(int xmlfd, const char *parent_id, icaltimezone *zone, exit(1); } - return ews_calitem_to_ical(xml_node, parent_id, zone, NULL /*hack_fetch_subitem*/, NULL, error); + comp = ews_calitem_to_ical(xml_node, parent_id, zone, NULL /*hack_fetch_subitem*/, NULL, error); + xmlFreeDoc(xml_doc); + return comp; } -- 2.49.0