From 2f01a3265debaf8bb4b21a20033dc73b71ddb2e4 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 18 Nov 2015 19:58:38 -0500 Subject: Exit if unable to allocate buffer --- wayland/buffers.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'wayland') diff --git a/wayland/buffers.c b/wayland/buffers.c index 6117e10b..7cbf926f 100644 --- a/wayland/buffers.c +++ b/wayland/buffers.c @@ -57,6 +57,9 @@ static struct buffer *create_buffer(struct client_state *state, struct buffer *b char *name; int fd = create_pool_file(size, &name); + if (fd == -1) { + sway_abort("Unable to allocate buffer"); + } void *data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); struct wl_shm_pool *pool = wl_shm_create_pool(state->shm, fd, size); buf->buffer = wl_shm_pool_create_buffer(pool, 0, width, height, stride, format); -- cgit v1.2.3-54-g00ecf