mirror of
https://github.com/swaywm/sway.git
synced 2025-11-17 06:59:48 -05:00
Handle calloc failures
This commit is contained in:
parent
a2b9149656
commit
10c8b73075
8 changed files with 39 additions and 2 deletions
|
|
@ -26,6 +26,9 @@ struct cmd_results *cmd_output(int argc, char **argv) {
|
|||
const char *name = argv[0];
|
||||
|
||||
struct output_config *output = calloc(1, sizeof(struct output_config));
|
||||
if (!output) {
|
||||
return cmd_results_new(CMD_FAILURE, "output", "Unable to allocate output config");
|
||||
}
|
||||
output->x = output->y = output->width = output->height = -1;
|
||||
output->name = strdup(name);
|
||||
output->enabled = -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue