[PATCH] weston-test: check if resource is not NULL

Pekka Paalanen ppaalanen at gmail.com
Thu Aug 21 04:25:44 PDT 2014


On Fri, 11 Jul 2014 12:33:02 +0200
Marek Chalupa <mchqwerty at gmail.com> wrote:

> and post client_no_memory if is...
> ---
>  tests/weston-test.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tests/weston-test.c b/tests/weston-test.c
> index 44875a6..cc937e5 100644
> --- a/tests/weston-test.c
> +++ b/tests/weston-test.c
> @@ -260,6 +260,11 @@ bind_test(struct wl_client *client, void *data, uint32_t version, uint32_t id)
>  	struct wl_resource *resource;
>  
>  	resource = wl_resource_create(client, &wl_test_interface, 1, id);
> +	if (!resource) {
> +		wl_client_post_no_memory(client);
> +		return;
> +	}
> +
>  	wl_resource_set_implementation(resource,
>  				       &test_implementation, test, NULL);
>  

An obvious fix is obvious. Doh! ;-D


Thanks,
pq


More information about the wayland-devel mailing list