aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/output/background.c
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-07-01 22:54:41 +0900
committerDominique Martinet <asmadeus@codewreck.org>2018-07-02 08:03:41 +0900
commita2354d599254941da46e3e17b929c1a40e816cc4 (patch)
treea9a584f1ea260c0c62ef10527d334f9dcb434841 /sway/commands/output/background.c
parentdf494a7e517281f21fde265bc31badae3245bb26 (diff)
cmd_background: fix leak on error
Found through static analysis.
Diffstat (limited to 'sway/commands/output/background.c')
-rw-r--r--sway/commands/output/background.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c
index 55cbdff0..65b5f902 100644
--- a/sway/commands/output/background.c
+++ b/sway/commands/output/background.c
@@ -81,8 +81,9 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
// src file is inside configuration dir
char *conf = strdup(config->current_config);
- if(!conf) {
+ if (!conf) {
wlr_log(L_ERROR, "Failed to duplicate string");
+ free(src);
return cmd_results_new(CMD_FAILURE, "output",
"Unable to allocate resources");
}