mirror of
https://github.com/swaywm/sway.git
synced 2024-12-29 00:16:22 +01:00
cmd_background: fix leak on error
Found through static analysis.
This commit is contained in:
parent
df494a7e51
commit
a2354d5992
1 changed files with 2 additions and 1 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue