summaryrefslogtreecommitdiff
path: root/src/compositor-wayland.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor-wayland.c')
-rw-r--r--src/compositor-wayland.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index f35db9c3..67f15be9 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -256,6 +256,12 @@ wayland_output_get_shm_buffer(struct wayland_output *output)
}
sb = zalloc(sizeof *sb);
+ if (sb == NULL) {
+ weston_log("could not zalloc %ld memory for sb: %m\n", sizeof *sb);
+ close(fd);
+ free(data);
+ return NULL;
+ }
sb->output = output;
wl_list_init(&sb->free_link);