From: Tim Stoakes Date: Sat, 22 Sep 2012 07:31:54 +0000 (+0200) Subject: Plug a leaked notmuch DB handle in get_count() X-Git-Tag: neomutt-20160404~13^2~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e97421687ca6c90e285206b3da17695be2462098;p=neomutt Plug a leaked notmuch DB handle in get_count() 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. --- diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 9ede705dd..b546ffc4a 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -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)