aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/libinput/keyboard.c')
-rw-r--r--backend/libinput/keyboard.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/backend/libinput/keyboard.c b/backend/libinput/keyboard.c
index db4ac0ed..1c52a6b8 100644
--- a/backend/libinput/keyboard.c
+++ b/backend/libinput/keyboard.c
@@ -32,8 +32,10 @@ struct wlr_keyboard_impl impl = {
struct wlr_keyboard *wlr_libinput_keyboard_create(
struct libinput_device *libinput_dev) {
assert(libinput_dev);
- struct wlr_libinput_keyboard *wlr_libinput_kb =
- calloc(1, sizeof(struct wlr_libinput_keyboard));
+ struct wlr_libinput_keyboard *wlr_libinput_kb;
+ if (!(wlr_libinput_kb= calloc(1, sizeof(struct wlr_libinput_keyboard)))) {
+ return NULL;
+ }
wlr_libinput_kb->libinput_dev = libinput_dev;
libinput_device_ref(libinput_dev);
libinput_device_led_update(libinput_dev, 0);