mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-01 07:15:32 -04: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':
|
case 'v':
|
||||||
printf("foot version %s\n", FOOT_VERSION);
|
printf("foot version %s\n", FOOT_VERSION);
|
||||||
|
config_free(conf);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
print_usage(prog_name);
|
print_usage(prog_name);
|
||||||
|
config_free(conf);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
||||||
case ':':
|
case ':':
|
||||||
fprintf(stderr, "error: -%c: missing required argument\n", optopt);
|
fprintf(stderr, "error: -%c: missing required argument\n", optopt);
|
||||||
|
config_free(conf);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
case '?':
|
case '?':
|
||||||
fprintf(stderr, "error: -%c: invalid option\n", optopt);
|
fprintf(stderr, "error: -%c: invalid option\n", optopt);
|
||||||
|
config_free(conf);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue