weston-test: check if resource is not NULL

and post client_no_memory if is...

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
dev
Marek Chalupa 11 years ago committed by Pekka Paalanen
parent c34b67702e
commit 42ebdda446
  1. 5
      tests/weston-test.c

@ -251,6 +251,11 @@ bind_test(struct wl_client *client, void *data, uint32_t version, uint32_t id)
struct wl_resource *resource; struct wl_resource *resource;
resource = wl_resource_create(client, &wl_test_interface, 1, id); resource = wl_resource_create(client, &wl_test_interface, 1, id);
if (!resource) {
wl_client_post_no_memory(client);
return;
}
wl_resource_set_implementation(resource, wl_resource_set_implementation(resource,
&test_implementation, test, NULL); &test_implementation, test, NULL);

Loading…
Cancel
Save