commit 5f7077b420fb300f2c1abe5bcd745eadb898bd3b
parent 3f17844a054c843293f71a5a8a66c6d09a6aae0d
Author: Michael Forney <mforney@mforney.org>
Date: Mon, 20 Jan 2014 20:37:56 -0800
output: Check to make sure resource creation succeeds
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/libswc/output.c b/libswc/output.c
@@ -24,6 +24,13 @@ static void bind_output(struct wl_client * client, void * data,
version = 2;
resource = wl_resource_create(client, &wl_output_interface, version, id);
+
+ if (!resource)
+ {
+ wl_client_post_no_memory(client);
+ return;
+ }
+
wl_resource_set_implementation(resource, NULL, output,
&swc_remove_resource);
wl_list_insert(&output->resources, wl_resource_get_link(resource));