aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.c
diff options
context:
space:
mode:
authorGravatar Jani Nikula <jani@nikula.org>2014-01-10 23:28:54 +0200
committerGravatar David Bremner <david@tethera.net>2014-01-18 14:46:05 -0400
commit40a3bf7e68338d34d10ddc77f746af53ff6d3182 (patch)
tree69a83d557da2a53756a30eaa066987a4b028a7fe /notmuch.c
parentc7453773064efbd0b2cd17b15ba483edbd28ce1e (diff)
cli: close config and do talloc report also on errors
Seems like the sensible thing to do.
Diffstat (limited to 'notmuch.c')
-rw-r--r--notmuch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/notmuch.c b/notmuch.c
index 2d7f33d3..b3fa9f37 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -256,7 +256,7 @@ main (int argc, char *argv[])
const char *command_name = NULL;
command_t *command;
char *config_file_name = NULL;
- notmuch_config_t *config;
+ notmuch_config_t *config = NULL;
notmuch_bool_t print_help=FALSE, print_version=FALSE;
int opt_index;
int ret;
@@ -316,7 +316,9 @@ main (int argc, char *argv[])
ret = (command->function)(config, argc - opt_index, argv + opt_index);
- notmuch_config_close (config);
+ DONE:
+ if (config)
+ notmuch_config_close (config);
talloc_report = getenv ("NOTMUCH_TALLOC_REPORT");
if (talloc_report && strcmp (talloc_report, "") != 0) {
@@ -334,7 +336,6 @@ main (int argc, char *argv[])
}
}
- DONE:
talloc_free (local);
return ret;