aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/libinput/events.c')
-rw-r--r--backend/libinput/events.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/backend/libinput/events.c b/backend/libinput/events.c
index dc5e4cb1..2a396536 100644
--- a/backend/libinput/events.c
+++ b/backend/libinput/events.c
@@ -44,11 +44,14 @@ static struct wlr_input_device *allocate_device(
return NULL;
}
struct wlr_input_device *wlr_dev = &wlr_libinput_dev->wlr_input_device;
+ if (list_add(wlr_devices, wlr_dev) == -1) {
+ free(wlr_libinput_dev);
+ return NULL;
+ }
wlr_libinput_dev->handle = libinput_dev;
libinput_device_ref(libinput_dev);
wlr_input_device_init(wlr_dev, type, &input_device_impl,
name, vendor, product);
- list_add(wlr_devices, wlr_dev);
return wlr_dev;
}