Prevent alloc errors from crashing

Resolves #76
This commit is contained in:
Calvin Lee 2017-08-15 07:56:47 +02:00
parent 5ca88af557
commit 5cc7342606
13 changed files with 109 additions and 13 deletions

View file

@ -239,7 +239,7 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat,
struct wlr_input_device *wlr_device = allocate_device(backend,
WLR_INPUT_DEVICE_KEYBOARD);
if (!wlr_device) {
wlr_log(L_ERROR, "Unable to allocate wl_pointer device");
wlr_log(L_ERROR, "Unable to allocate wl_keyboard device");
return;
}
wlr_device->keyboard = calloc(1, sizeof(struct wlr_keyboard));