mirror of
https://github.com/swaywm/sway.git
synced 2025-11-05 13:29:51 -05:00
Handle allocation failure in commands
This commit is contained in:
parent
8691ff1b63
commit
248df18c24
11 changed files with 78 additions and 16 deletions
|
|
@ -26,6 +26,9 @@ struct cmd_results *bar_cmd_bindsym(int argc, char **argv) {
|
|||
return cmd_results_new(CMD_INVALID, "bindsym", "Invalid mouse binding %s", argv[1]);
|
||||
}
|
||||
struct sway_mouse_binding *binding = malloc(sizeof(struct sway_mouse_binding));
|
||||
if (!binding) {
|
||||
return cmd_results_new(CMD_FAILURE, "bindsym", "Unable to allocate binding");
|
||||
}
|
||||
binding->button = numbutton;
|
||||
binding->command = join_args(argv + 1, argc - 1);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue