xwayland: make sure client is not gone in sync callback
in XWayland, dri3_send_open_reply() is called from a sync callback, so there is a possibility that the client might be gone when we get to the callback eventually, which leads to a crash in _XSERVTransSendFd() from WriteFdToClient() . Check if clientGone has been set in the sync callback handler to avoid this. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99149 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100040 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1416553 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Tested-by: Mark B <mark.blakeney@bullet-systems.net>
This commit is contained in:
parent
5c44169cae
commit
64ca14b85e
|
@ -435,9 +435,12 @@ static void
|
||||||
sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
|
sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
|
||||||
{
|
{
|
||||||
struct xwl_auth_state *state = data;
|
struct xwl_auth_state *state = data;
|
||||||
|
ClientPtr client = state->client;
|
||||||
|
|
||||||
dri3_send_open_reply(state->client, state->fd);
|
if (!client->clientGone) {
|
||||||
AttendClient(state->client);
|
dri3_send_open_reply(client, state->fd);
|
||||||
|
AttendClient(client);
|
||||||
|
}
|
||||||
free(state);
|
free(state);
|
||||||
wl_callback_destroy(callback);
|
wl_callback_destroy(callback);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue