X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-search.c;h=3be296d8a3f67db106d139c882544f3746eb4d8d;hp=1cc843075ec53b9d2ac0e973448c85422121adde;hb=93ab4c7d119bb751c4d7297cb18a6f5eb50ae478;hpb=fd62a25f91c6ecdd6d60c86b4439321b8e84b309 diff --git a/notmuch-search.c b/notmuch-search.c index 1cc84307..3be296d8 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -486,9 +486,8 @@ notmuch_search_command (void *ctx, int argc, char *argv[]) if (config == NULL) return 1; - notmuch = notmuch_database_open (notmuch_config_get_database_path (config), - NOTMUCH_DATABASE_MODE_READ_ONLY); - if (notmuch == NULL) + if (notmuch_database_open (notmuch_config_get_database_path (config), + NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much)) return 1; query_str = query_string_from_args (notmuch, argc-opt_index, argv+opt_index); @@ -545,7 +544,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[]) } notmuch_query_destroy (query); - notmuch_database_close (notmuch); + notmuch_database_destroy (notmuch); return ret; }