From ab19f937c29ddf008e402e1407ea3dc8243e861b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 20 Aug 2013 11:30:54 -0700 Subject: [PATCH] compositor: Only check buffer for NULL tried to allocate something In particular, if we get a NULL buffer attach, it's ok for buffer to be NULL. --- src/compositor.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index c084b923..78351eb1 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1442,11 +1442,12 @@ surface_attach(struct wl_client *client, struct weston_surface *surface = wl_resource_get_user_data(resource); struct weston_buffer *buffer = NULL; - if (buffer_resource) + if (buffer_resource) { buffer = weston_buffer_from_resource(buffer_resource); - if (buffer == NULL) { - wl_client_post_no_memory(client); - return; + if (buffer == NULL) { + wl_client_post_no_memory(client); + return; + } } /* Attach, attach, without commit in between does not send