fix(init): fix segfault for unknown flags

Swappy segfaults if it is invoked with unknown command-line flags
This commit is contained in:
pathetic-lynx 2020-01-23 13:44:48 +02:00 committed by Jeremy Attali
parent 196f7f4dea
commit f4e9a19407

View File

@ -184,9 +184,11 @@ void config_load(struct swappy_state *state) {
}
void config_free(struct swappy_state *state) {
g_free(state->config->config_file);
g_free(state->config->save_dir);
g_free(state->config->text_font);
g_free(state->config);
state->config = NULL;
}
if (state->config) {
g_free(state->config->config_file);
g_free(state->config->save_dir);
g_free(state->config->text_font);
g_free(state->config);
state->config = NULL;
}
}