]> www.infradead.org Git - users/dwmw2/ews-sync.git/commitdiff
Free items on completion
authorDavid Woodhouse <dwmw2@infradead.org>
Thu, 22 Jul 2010 15:28:57 +0000 (16:28 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Thu, 22 Jul 2010 15:28:57 +0000 (16:28 +0100)
ews2ical.c

index b46b2ac983c5b11cd1d7610006bdf8dcaf79ce03..68d14197dec05c2e2ae9c40675253636ab43c7b4 100644 (file)
@@ -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;
 }