From: David Woodhouse Date: Thu, 22 Jul 2010 15:28:57 +0000 (+0100) Subject: Free items on completion X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=dfd95ba7b0c2180772b9217f886ed0481c2a20e6;p=users%2Fdwmw2%2Fews-sync.git Free items on completion --- 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; }