From ab3a397d58898045c3461bbdca8f48361ccfb8f4 Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 8 Oct 2018 15:21:20 +0200 Subject: [PATCH] Fix memory leak in status_command handler --- sway/commands/bar/status_command.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sway/commands/bar/status_command.c b/sway/commands/bar/status_command.c index 5ea225256..5b4fdc87d 100644 --- a/sway/commands/bar/status_command.c +++ b/sway/commands/bar/status_command.c @@ -20,6 +20,8 @@ struct cmd_results *bar_cmd_status_command(int argc, char **argv) { config->current_bar->status_command = new_command; wlr_log(WLR_DEBUG, "Feeding bar with status command: %s", config->current_bar->status_command); + } else { + free(new_command); } if (config->active && !config->validating) {