mirror of
https://github.com/swaywm/sway.git
synced 2026-04-06 07:15:44 -04:00
Handle calloc failures
This commit is contained in:
parent
a2b9149656
commit
10c8b73075
8 changed files with 39 additions and 2 deletions
10
sway/input.c
10
sway/input.c
|
|
@ -11,8 +11,16 @@
|
|||
|
||||
struct input_config *new_input_config(const char* identifier) {
|
||||
struct input_config *input = calloc(1, sizeof(struct input_config));
|
||||
if (!input) {
|
||||
sway_log(L_DEBUG, "Unable to allocate input config");
|
||||
return NULL;
|
||||
}
|
||||
sway_log(L_DEBUG, "new_input_config(%s)", identifier);
|
||||
input->identifier = strdup(identifier);
|
||||
if (!(input->identifier = strdup(identifier))) {
|
||||
free(input);
|
||||
sway_log(L_DEBUG, "Unable to allocate input config");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
input->tap = INT_MIN;
|
||||
input->drag_lock = INT_MIN;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue