From: Carl Worth Date: Wed, 21 Oct 2009 05:27:56 +0000 (-0700) Subject: notmuch dump: Free each message as it's used. X-Git-Tag: 0.1~805 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=aad13c3ac947a42b3e0a1923c44a927feea827f5 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. --- diff --git a/notmuch.c b/notmuch.c index cedfebce..43af75d2 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);