[krh/wayland/next 4/5] wayland-server: Make sure client object exist before dereferencing.

John Kåre Alsaker john.kare.alsaker at gmail.com
Fri Oct 12 02:28:27 PDT 2012


---
 src/wayland-server.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/wayland-server.c b/src/wayland-server.c
index f076dcb..22e6a4e 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -992,7 +992,9 @@ bind_display(struct wl_client *client,
 	client->display_resource =
 		wl_client_add_object(client, &wl_display_interface,
 				     &display_interface, id, display);
-	client->display_resource->destroy = destroy_client_display_resource;
+
+	if(client->display_resource)
+		client->display_resource->destroy = destroy_client_display_resource;
 }
 
 WL_EXPORT struct wl_display *
-- 
1.7.12.2



More information about the wayland-devel mailing list