aboutsummaryrefslogtreecommitdiff
path: root/notmuch.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-10-20 22:27:56 -0700
committerCarl Worth <cworth@cworth.org>2009-10-20 22:27:56 -0700
commitaad13c3ac947a42b3e0a1923c44a927feea827f5 (patch)
tree79ff07401de28bfc2c5b24ff141bb85306a8cb87 /notmuch.c
parent4ca1492f1b6a9172b1dca88aecf1d6e7394ac5d7 (diff)
notmuch dump: Free each message as it's used.
Previously we were leaking[*] memory in that the memory footprint of a "notmuch dump" run would continue to grow until the output was complete, and then finally all the memory would be freed. Now, the memory footprint is small and constant, O(1) rather than O(n) in the number of messages. [*] Not leaking in a valgrind sense---every byte was still carefully being accounted for and freed eventually.
Diffstat (limited to 'notmuch.c')
-rw-r--r--notmuch.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/notmuch.c b/notmuch.c
index cedfebc..43af75d 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -431,6 +431,8 @@ dump_command (int argc, char *argv[])
}
fprintf (output, ")\n");
+
+ notmuch_message_destroy (message);
}
notmuch_query_destroy (query);