]> granicus.if.org Git - neomutt/commitdiff
add notmuch_{query,message}_destroy to DB checker
authorKarel Zak <kzak@redhat.com>
Thu, 20 Sep 2012 07:31:54 +0000 (09:31 +0200)
committerRichard Russon <rich@flatcap.org>
Mon, 4 Apr 2016 15:30:06 +0000 (16:30 +0100)
Reported-by: Chris Mason <chris.mason@fusionio.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
mutt_notmuch.c

index 5b190d344bc348c4cd83674dea6491b0ecbd3b7a..c84157a0480b18aaf7fc876b71a1cb2433ed214c 100644 (file)
@@ -1474,6 +1474,7 @@ int nm_check_database(CONTEXT *ctx, int *index_hint)
                if (!h) {
                        /* new email */
                        append_message(ctx, m);
+                       notmuch_message_destroy(m);
                        continue;
                }
 
@@ -1502,6 +1503,8 @@ int nm_check_database(CONTEXT *ctx, int *index_hint)
 
                if (update_header_tags(h, m) == 0)
                        new_flags++;
+
+               notmuch_message_destroy(m);
        }
 
        for (i = 0; i < ctx->msgcount; i++) {
@@ -1514,6 +1517,9 @@ int nm_check_database(CONTEXT *ctx, int *index_hint)
        if (ctx->msgcount > oldmsgcount)
                mx_update_context(ctx, ctx->msgcount - oldmsgcount);
 done:
+       if (q)
+               notmuch_query_destroy(q);
+
        if (!is_longrun(data))
                release_db(data);