Check zalloc return for out of memory situation
Most zalloc calls in weston are checked, this fixes a handful that were
being ignored. As found by `grep -EIsr "[^x]zalloc\(" . -A1`
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index f35db9c..67f15be 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -256,6 +256,12 @@
}
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);