xwayland: Fix user after free on shutdown

We need to remove our listener link before we free the structure
it's inside, or the signal list walk will try to dereference it.

Remove the improbable NULL check at the same time.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
dev
Derek Foreman 3 years ago committed by Daniel Stone
parent 6c2646e967
commit c826d8fa0d
  1. 3
      xwayland/launcher.c

@ -224,8 +224,7 @@ weston_xserver_destroy(struct wl_listener *l, void *data)
struct weston_xserver *wxs = struct weston_xserver *wxs =
container_of(l, struct weston_xserver, destroy_listener); container_of(l, struct weston_xserver, destroy_listener);
if (!wxs) wl_list_remove(&wxs->destroy_listener.link);
return;
if (wxs->loop) if (wxs->loop)
weston_xserver_shutdown(wxs); weston_xserver_shutdown(wxs);

Loading…
Cancel
Save