mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 01:14:53 +01:00
cppcheck: close files during shutdown
Fix the following cppcheck errors: notmuch-count.c:207: error: Resource leak: input notmuch-tag.c:238: error: Resource leak: input We know that the program is shutting down here, but it does no harm to clean up a bit.
This commit is contained in:
parent
af64530d3f
commit
c960bb4686
2 changed files with 4 additions and 0 deletions
|
@ -204,6 +204,8 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[])
|
|||
|
||||
if (batch && opt_index != argc) {
|
||||
fprintf (stderr, "--batch and query string are not compatible\n");
|
||||
if (input)
|
||||
fclose (input);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
@ -235,6 +235,8 @@ notmuch_tag_command (notmuch_config_t *config, int argc, char *argv[])
|
|||
if (batch) {
|
||||
if (opt_index != argc) {
|
||||
fprintf (stderr, "Can't specify both cmdline and stdin!\n");
|
||||
if (input)
|
||||
fclose (input);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue