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

Marek Chalupa mchqwerty at gmail.com
Fri Jul 11 03:33:02 PDT 2014


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);
 
-- 
2.0.1



More information about the wayland-devel mailing list