mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 12:28:04 +02:00
data-device.c: Handle OOM in wl_data_source_send_offer()
If we fail to allocate the resource, clean up and return NULL.
This commit is contained in:
parent
62af918cdb
commit
403931ed22
1 changed files with 5 additions and 0 deletions
|
|
@ -120,6 +120,11 @@ wl_data_source_send_offer(struct wl_data_source *source,
|
|||
offer->resource =
|
||||
wl_resource_create(wl_resource_get_client(target),
|
||||
&wl_data_offer_interface, 1, 0);
|
||||
if (offer->resource == NULL) {
|
||||
free(offer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wl_resource_set_implementation(offer->resource, &data_offer_interface,
|
||||
offer, destroy_data_offer);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue