From ba8981e44bd6cceedd3d32a2e6af947ba791be48 Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Sun, 15 Jul 2018 21:47:22 +0100 Subject: [PATCH] bar: free old position when changing --- sway/commands/bar/position.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sway/commands/bar/position.c b/sway/commands/bar/position.c index 48e7ddbd2..44bb4ae37 100644 --- a/sway/commands/bar/position.c +++ b/sway/commands/bar/position.c @@ -17,6 +17,7 @@ struct cmd_results *bar_cmd_position(int argc, char **argv) { if (strcasecmp(valid[i], argv[0]) == 0) { wlr_log(WLR_DEBUG, "Setting bar position '%s' for bar: %s", argv[0], config->current_bar->id); + free(config->current_bar->position); config->current_bar->position = strdup(argv[0]); return cmd_results_new(CMD_SUCCESS, NULL, NULL); }