diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-11-09 18:32:54 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-11-09 18:32:54 -0500 |
commit | 1472dbda74dea5387a4d0e531b641734131dc705 (patch) | |
tree | c58c9930774e85eb8b40a46b8a7e96ef66911f66 /rootston/seat.c | |
parent | d6513cef5dc3f2c20e1bf11ff6a468b60ce35aca (diff) |
rootston: roots_keyboard null check
Diffstat (limited to 'rootston/seat.c')
-rw-r--r-- | rootston/seat.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rootston/seat.c b/rootston/seat.c index 97d5c7e4..72e94aec 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -306,6 +306,11 @@ void roots_seat_destroy(struct roots_seat *seat) { static void seat_add_keyboard(struct roots_seat *seat, struct wlr_input_device *device) { assert(device->type == WLR_INPUT_DEVICE_KEYBOARD); struct roots_keyboard *keyboard = roots_keyboard_create(device, seat->input); + if (keyboard == NULL) { + wlr_log(L_ERROR, "could not allocate keyboard for seat"); + return; + } + keyboard->seat = seat; wl_list_insert(&seat->keyboards, &keyboard->link); |