Skip to content

Commit

Permalink
Merge pull request #2091 from martinetd/config-block-use-after-free
Browse files Browse the repository at this point in the history
sway/config: fix use-after-free for end of block
  • Loading branch information
ddevault authored Jun 2, 2018
2 parents df204b6 + 71ab13f commit 5b72e86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sway/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,13 +626,13 @@ bool read_config(FILE *file, struct sway_config *config) {
success = false;
break;
}
wlr_log(L_DEBUG, "Exiting block '%s'", block);
list_del(stack, 0);
free(block);

if (strcmp(block, "bar") == 0) {
config->current_bar = NULL;
}

wlr_log(L_DEBUG, "Exiting block '%s'", block);
list_del(stack, 0);
free(block);
memset(&config->handler_context, 0,
sizeof(config->handler_context));
default:;
Expand Down

0 comments on commit 5b72e86

Please sign in to comment.