mirror of
https://github.com/swaywm/sway.git
synced 2026-04-26 06:46:26 -04:00
commands/bar: Fix memory leak
This commit is contained in:
parent
8441711990
commit
00d3dc8f71
1 changed files with 4 additions and 2 deletions
|
|
@ -23,7 +23,9 @@ static struct cmd_results *parse_single_color(char **color,
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
if (!*color && !(*color = malloc(10))) {
|
if (!*color && !(*color = malloc(10))) {
|
||||||
return NULL;
|
if (*color == NULL) {
|
||||||
|
free(color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
error = add_color(*color, argv[0]);
|
error = add_color(*color, argv[0]);
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue