X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdatabase.cc;h=94022d7ce3ae9c060ecf18baaca1aa95afa11781;hp=8103bd96ef88c0e30f256753145f17f5583118a2;hb=6c0adab23eadb81bb1254f4b82175902df11bb3f;hpb=f80d4f9f6dc402d264f802241c17e26e7aa72851 diff --git a/lib/database.cc b/lib/database.cc index 8103bd96..94022d7c 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -617,7 +617,7 @@ notmuch_database_open (const char *path, initialized = 1; } - notmuch = talloc (NULL, notmuch_database_t); + notmuch = talloc_zero (NULL, notmuch_database_t); notmuch->exception_reported = FALSE; notmuch->path = talloc_strdup (notmuch, path); @@ -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; }