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.
This commit is contained in:
Austin Clements 2012-01-29 00:50:09 -05:00 committed by David Bremner
parent a8ee1c75c3
commit 6c0adab23e

View file

@ -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;
}