From bc3365b1693ce2a2c795a489c64738a42d5c7e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Pe=C3=B1acoba?= Date: Wed, 10 May 2017 22:21:16 +0200 Subject: video/out/wayland/buffer.c: Add missing free() --- video/out/wayland/buffer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/video/out/wayland/buffer.c b/video/out/wayland/buffer.c index aae590eba2..dce3ca4333 100644 --- a/video/out/wayland/buffer.c +++ b/video/out/wayland/buffer.c @@ -40,13 +40,16 @@ shm_buffer_t* shm_buffer_create(uint32_t width, shm_buffer_t *buffer = calloc(1, sizeof(shm_buffer_t)); int fd = memfile_create(size); - if (fd < 0) + if (fd < 0) { + free(buffer); return NULL; + } buffer->data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (buffer->data == MAP_FAILED) { close(fd); + free(buffer); return NULL; } -- cgit v1.2.3