mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-01-03 15:21:41 +01:00
cli: close config and do talloc report also on errors
Seems like the sensible thing to do.
This commit is contained in:
parent
c745377306
commit
40a3bf7e68
1 changed files with 4 additions and 3 deletions
|
@ -256,7 +256,7 @@ main (int argc, char *argv[])
|
||||||
const char *command_name = NULL;
|
const char *command_name = NULL;
|
||||||
command_t *command;
|
command_t *command;
|
||||||
char *config_file_name = NULL;
|
char *config_file_name = NULL;
|
||||||
notmuch_config_t *config;
|
notmuch_config_t *config = NULL;
|
||||||
notmuch_bool_t print_help=FALSE, print_version=FALSE;
|
notmuch_bool_t print_help=FALSE, print_version=FALSE;
|
||||||
int opt_index;
|
int opt_index;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -316,6 +316,8 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
ret = (command->function)(config, argc - opt_index, argv + opt_index);
|
ret = (command->function)(config, argc - opt_index, argv + opt_index);
|
||||||
|
|
||||||
|
DONE:
|
||||||
|
if (config)
|
||||||
notmuch_config_close (config);
|
notmuch_config_close (config);
|
||||||
|
|
||||||
talloc_report = getenv ("NOTMUCH_TALLOC_REPORT");
|
talloc_report = getenv ("NOTMUCH_TALLOC_REPORT");
|
||||||
|
@ -334,7 +336,6 @@ main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DONE:
|
|
||||||
talloc_free (local);
|
talloc_free (local);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue