Skip to content

Commit

Permalink
fix(init): fix segfault for unknown flags
Browse files Browse the repository at this point in the history
Swappy segfaults if it is invoked with unknown command-line flags
  • Loading branch information
pathetic-lynx authored and jtheoof committed Jan 23, 2020
1 parent 196f7f4 commit f4e9a19
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit f4e9a19

Please sign in to comment.