mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
server: Handle OOM properly when we fail to allocate a send closure
If we can't allocate a closure, don't just silently continue. Set client->error so we shut down the client when we're done processing events.
This commit is contained in:
parent
d2aac9dca9
commit
c0eb45286c
1 changed files with 6 additions and 2 deletions
|
|
@ -136,8 +136,10 @@ wl_resource_post_event(struct wl_resource *resource, uint32_t opcode, ...)
|
|||
&object->interface->events[opcode]);
|
||||
va_end(ap);
|
||||
|
||||
if (closure == NULL)
|
||||
if (closure == NULL) {
|
||||
resource->client->error = 1
|
||||
return;
|
||||
}
|
||||
|
||||
if (wl_closure_send(closure, resource->client->connection))
|
||||
wl_event_loop_add_idle(resource->client->display->loop,
|
||||
|
|
@ -162,8 +164,10 @@ wl_resource_queue_event(struct wl_resource *resource, uint32_t opcode, ...)
|
|||
&object->interface->events[opcode]);
|
||||
va_end(ap);
|
||||
|
||||
if (closure == NULL)
|
||||
if (closure == NULL) {
|
||||
resource->client->error = 1
|
||||
return;
|
||||
}
|
||||
|
||||
if (wl_closure_queue(closure, resource->client->connection))
|
||||
wl_event_loop_add_idle(resource->client->display->loop,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue