main: free config if we fail to load the config

This commit is contained in:
Daniel Eklöf 2020-03-09 20:04:25 +01:00
parent 048edc58f1
commit c993148635
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

4
main.c
View file

@ -273,8 +273,10 @@ main(int argc, char *const *argv)
argv += optind; argv += optind;
struct config conf = {NULL}; struct config conf = {NULL};
if (!config_load(&conf, conf_path)) if (!config_load(&conf, conf_path)) {
config_free(conf);
return ret; return ret;
}
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
if (!locale_is_utf8()) { if (!locale_is_utf8()) {