diff --git a/src/handlers.c b/src/handlers.c index 148d6337..cb76eb78 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -119,7 +119,9 @@ static void handle_key_press(xcb_key_press_event_t *event) { } } - struct CommandResult *command_output = parse_command(bind->command); + char *command_copy = sstrdup(bind->command); + struct CommandResult *command_output = parse_command(command_copy); + free(command_copy); if (command_output->needs_tree_render) tree_render();