backend-wayland: do not try to release uninitialized seat

Do not call weston_seat_release() if Weston aborts before
weston_seat_init() could be called. This fixes a possible
segfault due to uninitialized list traversal in the error
path.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
Philipp Zabel 2022-11-30 14:05:14 +01:00
parent fdaf4cf320
commit c448819b37

View file

@ -2430,7 +2430,8 @@ wayland_input_destroy(struct wayland_input *input)
if (input->touch_device)
weston_touch_device_destroy(input->touch_device);
weston_seat_release(&input->base);
if (input->seat_initialized)
weston_seat_release(&input->base);
if (input->parent.keyboard) {
if (input->seat_version >= WL_KEYBOARD_RELEASE_SINCE_VERSION)