diff --git a/lib/database.cc b/lib/database.cc index a6d15a13..94022d7c 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -703,6 +703,7 @@ notmuch_database_open (const char *path, } catch (const Xapian::Error &error) { fprintf (stderr, "A Xapian exception occurred opening database: %s\n", error.get_msg().c_str()); + notmuch_database_close (notmuch); notmuch = NULL; }