kbd->server = server;
context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
+ if (!context)
+ goto err;
+
keymap = xkb_keymap_new_from_names(context, NULL,
XKB_KEYMAP_COMPILE_NO_FLAGS);
if (!keymap) {
ds_err("Failed to compile keymap");
xkb_context_unref(context);
+ goto err;
}
ds_keyboard_set_keymap(ds_input_device_get_keyboard(dev), keymap);
wl_list_insert(&server->keyboards, &kbd->link);
ds_inf("Keyboard(%p) added", kbd);
+
+ return;
+
+err:
+ free(kbd);
}
static struct tinyds_view *