aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/workspace.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-12-15 18:26:53 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-12-15 19:01:41 -0500
commit10c8b73075fa0dd5512cc14be7240ec47f68dece (patch)
treee8835ef640d1d21ce0f36a5b1bcee726d926e55e /sway/commands/workspace.c
parentAdd remaining sway allocation failure handling (diff)
downloadsway-10c8b73075fa0dd5512cc14be7240ec47f68dece.tar.gz
sway-10c8b73075fa0dd5512cc14be7240ec47f68dece.tar.zst
sway-10c8b73075fa0dd5512cc14be7240ec47f68dece.zip
Handle calloc failures
Diffstat (limited to 'sway/commands/workspace.c')
-rw-r--r--sway/commands/workspace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c
index 35224f8a..14fe242f 100644
--- a/sway/commands/workspace.c
+++ b/sway/commands/workspace.c
@@ -61,6 +61,10 @@ struct cmd_results *cmd_workspace(int argc, char **argv) {
61 return error; 61 return error;
62 } 62 }
63 struct workspace_output *wso = calloc(1, sizeof(struct workspace_output)); 63 struct workspace_output *wso = calloc(1, sizeof(struct workspace_output));
64 if (!wso) {
65 return cmd_results_new(CMD_FAILURE, "workspace output",
66 "Unable to allocate workspace output");
67 }
64 wso->workspace = strdup(argv[0]); 68 wso->workspace = strdup(argv[0]);
65 wso->output = strdup(argv[2]); 69 wso->output = strdup(argv[2]);
66 int i = -1; 70 int i = -1;