diff options
author | Raúl Peñacoba <raul.mikaop.zelda@gmail.com> | 2017-05-10 22:21:16 +0200 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-05-26 08:52:12 +0100 |
commit | bc3365b1693ce2a2c795a489c64738a42d5c7e6b (patch) | |
tree | a24980df9685c983f11f9f1aa48bea79627c848c /video/out/wayland/buffer.c | |
parent | b7d0dfaf1a8fe33f555679ebaf132caa4d9842c9 (diff) | |
download | mpv-bc3365b1693ce2a2c795a489c64738a42d5c7e6b.tar.bz2 mpv-bc3365b1693ce2a2c795a489c64738a42d5c7e6b.tar.xz |
video/out/wayland/buffer.c: Add missing free()
Diffstat (limited to 'video/out/wayland/buffer.c')
-rw-r--r-- | video/out/wayland/buffer.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |