From ba8981e44bd6cceedd3d32a2e6af947ba791be48 Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Sun, 15 Jul 2018 21:47:22 +0100 Subject: [PATCH 1/3] 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); } From 92450883d7b148d408b42c3553a60340a14771f6 Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Sun, 15 Jul 2018 21:48:39 +0100 Subject: [PATCH 2/3] config: free include path on successful load --- sway/config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sway/config.c b/sway/config.c index 2c0511466..f63835bf5 100644 --- a/sway/config.c +++ b/sway/config.c @@ -474,6 +474,7 @@ static bool load_include_config(const char *path, const char *parent_dir, list_del(config->config_chain, index); return false; } + free(real_path); // restore current_config_path config->current_config_path = parent_config; From 9559e3e2afeabc5fd68ee0679ad9b5745c92425b Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Sun, 15 Jul 2018 21:51:00 +0100 Subject: [PATCH 3/3] config output: free command string if unused --- sway/config/output.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sway/config/output.c b/sway/config/output.c index 205e2633c..1bf9e5f11 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -207,6 +207,8 @@ void apply_output_config(struct output_config *oc, struct sway_container *output output->sway_output->bg_pid = fork(); if (output->sway_output->bg_pid == 0) { execvp(cmd[0], cmd); + } else { + free(command); } } if (oc && oc->dpms_state != DPMS_IGNORE) {