mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-11 04:27:49 -05:00
main: free 'config' on command line parse error
This commit is contained in:
parent
18921f7f45
commit
a853896715
1 changed files with 4 additions and 0 deletions
4
main.c
4
main.c
|
|
@ -107,18 +107,22 @@ main(int argc, char *const *argv)
|
|||
|
||||
case 'v':
|
||||
printf("foot version %s\n", FOOT_VERSION);
|
||||
config_free(conf);
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
case 'h':
|
||||
print_usage(prog_name);
|
||||
config_free(conf);
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
case ':':
|
||||
fprintf(stderr, "error: -%c: missing required argument\n", optopt);
|
||||
config_free(conf);
|
||||
return EXIT_FAILURE;
|
||||
|
||||
case '?':
|
||||
fprintf(stderr, "error: -%c: invalid option\n", optopt);
|
||||
config_free(conf);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue