aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/database.cc
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-01-29 00:50:09 -0500
committerGravatar David Bremner <bremner@debian.org>2012-02-03 21:15:26 -0400
commit6c0adab23eadb81bb1254f4b82175902df11bb3f (patch)
tree474786841acf74f768b64e5c1c8e0aeffa559c0a /lib/database.cc
parenta8ee1c75c348f41d88398fc394812e66e8e8b72e (diff)
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.
Diffstat (limited to 'lib/database.cc')
-rw-r--r--lib/database.cc1
1 files changed, 1 insertions, 0 deletions
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;
}