From 6c0adab23eadb81bb1254f4b82175902df11bb3f Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sun, 29 Jan 2012 00:50:09 -0500 Subject: [PATCH] lib: Release resources if notmuch_database_open fails Previously, if a Xapian exception occurred in notmuch_database_open, we failed to clean up the allocated notmuch_database_t object. --- lib/database.cc | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.43.0