mirror of
https://github.com/swaywm/sway.git
synced 2025-11-16 06:59:49 -05:00
Handle calloc failures
This commit is contained in:
parent
a2b9149656
commit
10c8b73075
8 changed files with 39 additions and 2 deletions
|
|
@ -61,6 +61,10 @@ struct cmd_results *cmd_workspace(int argc, char **argv) {
|
|||
return error;
|
||||
}
|
||||
struct workspace_output *wso = calloc(1, sizeof(struct workspace_output));
|
||||
if (!wso) {
|
||||
return cmd_results_new(CMD_FAILURE, "workspace output",
|
||||
"Unable to allocate workspace output");
|
||||
}
|
||||
wso->workspace = strdup(argv[0]);
|
||||
wso->output = strdup(argv[2]);
|
||||
int i = -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue