From: Austin Clements Date: Sun, 29 Jan 2012 05:50:09 +0000 (-0500) Subject: lib: Release resources if notmuch_database_open fails X-Git-Tag: debian/0.12_rc1-1~128 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6c0adab23eadb81bb1254f4b82175902df11bb3f;p=notmuch.git 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. --- 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; }