From fe6083493e959836c1a7280823a6820ab5341938 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 11 Dec 2020 19:54:56 -0500 Subject: Free threads and envelopes after concat Kind of important for the idle loop huh. --- archive.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/archive.c b/archive.c index 756f822..86f0687 100644 --- a/archive.c +++ b/archive.c @@ -218,6 +218,7 @@ examine:; concat:; enum Atom concat = atom("concat"); + struct List envelopeItems = {0}; struct Envelope *envelopes = calloc(threads.len, sizeof(*envelopes)); if (!envelopes) err(EX_OSERR, "calloc"); concatFetch(imap.w, concat, threads); @@ -227,12 +228,21 @@ concat:; // Prevent freeing data in envelopes with resp: struct Data items = dataTake(&resp.data.ptr[0]); concatData(threads, envelopes, dataCheck(items, List).list); + listPush(&envelopeItems, items); } respFree(resp); concatThreads(threads, envelopes); concatIndex(threads, envelopes); uidWrite("UIDNEXT", uidNext); + + for (size_t i = 0; i < threads.len; ++i) { + envelopeFree(envelopes[i]); + } + free(envelopes); + listFree(envelopeItems); + listFree(threads); + if (!idle) goto logout; idle: -- cgit 1.4.1