]> granicus.if.org Git - neomutt/commitdiff
Plug a leaked notmuch DB handle in get_count()
authorTim Stoakes <tim@stoakes.net>
Sat, 22 Sep 2012 07:31:54 +0000 (09:31 +0200)
committerRichard Russon <rich@flatcap.org>
Mon, 14 Mar 2016 23:11:41 +0000 (23:11 +0000)
nm_nonctx_get_count() was leaking its notmuch database handle if NOTMUCH_API_3
was in use. Looks like it missed the same treatment that the other call sites
got to do this.

mutt_notmuch.c

index 9ede705dd96a2c8dff274e78ff5550b14cb76652..b546ffc4a8461e4c4f16d87b39394524ba31d6df 100644 (file)
@@ -1379,7 +1379,11 @@ int nm_nonctx_get_count(char *path, int *all, int *new)
        rc = 0;
 done:
        if (db) {
+#ifdef NOTMUCH_API_3
+               notmuch_database_destroy(db);
+#else
                notmuch_database_close(db);
+#endif
                dprint(1, (debugfile, "nm: count close DB\n"));
        }
        if (!dflt)