libuwac/input: Fix memory leak
`create_pointer_buffer()` allocates memory with `mmap` and never frees it.
Adding a corresponding `munmap` fixes this issue.
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#include <errno.h>
#include <time.h>
#include <unistd.h>
#include <sys/mman.h>
@@ -69,6 +70,10 @@ static struct wl_buffer* create_pointer_buffer(UwacSeat* seat, const void* src,
seat->pointer_image->width * 4, WL_SHM_FORMAT_ARGB8888);
wl_shm_pool_destroy(pool);
+ if (munmap(data, size) < 0)
+ fprintf(stderr, "%s: munmap(%p, %" PRIuz ") failed with [%d] %s\n", __FUNCTION__, data,
+ size, errno, strerror(errno));
+
error_mmap:
close(fd);
return buffer;
