aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2018-07-15 21:47:22 +0100
committerIan Fan <ianfan0@gmail.com>2018-07-15 21:47:22 +0100
commitba8981e44bd6cceedd3d32a2e6af947ba791be48 (patch)
tree2098b1d0ecb99ceaa124db7234b1cd4afb2327c7
parent87334dbccb2c00ab72e96d4b58cf128dfbf8f751 (diff)
bar: free old position when changing
-rw-r--r--sway/commands/bar/position.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sway/commands/bar/position.c b/sway/commands/bar/position.c
index 48e7ddbd..44bb4ae3 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);
}