diff options
Diffstat (limited to 'sway/commands/output/background.c')
-rw-r--r-- | sway/commands/output/background.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c index 55cbdff0..4ed56c2a 100644 --- a/sway/commands/output/background.c +++ b/sway/commands/output/background.c | |||
@@ -72,7 +72,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
72 | src = strdup(p.we_wordv[0]); | 72 | src = strdup(p.we_wordv[0]); |
73 | wordfree(&p); | 73 | wordfree(&p); |
74 | if (!src) { | 74 | if (!src) { |
75 | wlr_log(L_ERROR, "Failed to duplicate string"); | 75 | wlr_log(WLR_ERROR, "Failed to duplicate string"); |
76 | return cmd_results_new(CMD_FAILURE, "output", | 76 | return cmd_results_new(CMD_FAILURE, "output", |
77 | "Unable to allocate resource"); | 77 | "Unable to allocate resource"); |
78 | } | 78 | } |
@@ -80,9 +80,10 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
80 | if (config->reading && *src != '/') { | 80 | if (config->reading && *src != '/') { |
81 | // src file is inside configuration dir | 81 | // src file is inside configuration dir |
82 | 82 | ||
83 | char *conf = strdup(config->current_config); | 83 | char *conf = strdup(config->current_config_path); |
84 | if(!conf) { | 84 | if (!conf) { |
85 | wlr_log(L_ERROR, "Failed to duplicate string"); | 85 | wlr_log(WLR_ERROR, "Failed to duplicate string"); |
86 | free(src); | ||
86 | return cmd_results_new(CMD_FAILURE, "output", | 87 | return cmd_results_new(CMD_FAILURE, "output", |
87 | "Unable to allocate resources"); | 88 | "Unable to allocate resources"); |
88 | } | 89 | } |
@@ -93,7 +94,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
93 | if (!src) { | 94 | if (!src) { |
94 | free(rel_path); | 95 | free(rel_path); |
95 | free(conf); | 96 | free(conf); |
96 | wlr_log(L_ERROR, "Unable to allocate memory"); | 97 | wlr_log(WLR_ERROR, "Unable to allocate memory"); |
97 | return cmd_results_new(CMD_FAILURE, "output", | 98 | return cmd_results_new(CMD_FAILURE, "output", |
98 | "Unable to allocate resources"); | 99 | "Unable to allocate resources"); |
99 | } | 100 | } |