Merge pull request #169 from acrisci/bug/keyboard-libinput-free
fix libinput wlr-keyboard use after free
This commit is contained in:
commit
6479fb27be
|
@ -21,7 +21,6 @@ static void wlr_libinput_keyboard_destroy(struct wlr_keyboard *wlr_kb) {
|
||||||
struct wlr_libinput_keyboard *wlr_libinput_kb =
|
struct wlr_libinput_keyboard *wlr_libinput_kb =
|
||||||
(struct wlr_libinput_keyboard *)wlr_kb;
|
(struct wlr_libinput_keyboard *)wlr_kb;
|
||||||
libinput_device_unref(wlr_libinput_kb->libinput_dev);
|
libinput_device_unref(wlr_libinput_kb->libinput_dev);
|
||||||
free(wlr_libinput_kb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_keyboard_impl impl = {
|
struct wlr_keyboard_impl impl = {
|
||||||
|
|
|
@ -41,9 +41,9 @@ void wlr_keyboard_destroy(struct wlr_keyboard *kb) {
|
||||||
kb->impl->destroy(kb);
|
kb->impl->destroy(kb);
|
||||||
} else {
|
} else {
|
||||||
wl_list_remove(&kb->events.key.listener_list);
|
wl_list_remove(&kb->events.key.listener_list);
|
||||||
free(kb);
|
|
||||||
}
|
}
|
||||||
close(kb->keymap_fd);
|
close(kb->keymap_fd);
|
||||||
|
free(kb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wlr_keyboard_led_update(struct wlr_keyboard *kb, uint32_t leds) {
|
void wlr_keyboard_led_update(struct wlr_keyboard *kb, uint32_t leds) {
|
||||||
|
|
Loading…
Reference in New Issue