aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shm.c b/shm.c
index 95b7ac78..54015798 100644
--- a/shm.c
+++ b/shm.c
@@ -105,7 +105,7 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie)
*/
int pool_fd = -1;
- void *mmapped = NULL;
+ void *mmapped = MAP_FAILED;
size_t size = 0;
struct wl_shm_pool *pool = NULL;
@@ -199,7 +199,7 @@ err:
wl_shm_pool_destroy(pool);
if (pool_fd != -1)
close(pool_fd);
- if (mmapped != NULL)
+ if (mmapped != MAP_FAILED)
munmap(mmapped, size);
return NULL;