From ed168aab27516a465085604e96fafe3c0b99d42c Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 9 Feb 2014 23:39:20 +0000 Subject: [PATCH] Fix handling of mmap failure --- common/compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/compat.c b/common/compat.c index 9aa556a..4a5dfa1 100644 --- a/common/compat.c +++ b/common/compat.c @@ -218,7 +218,7 @@ p11_mmap_open (const char *path, map->size = sb->st_size; map->data = mmap (NULL, map->size, PROT_READ, MAP_PRIVATE, map->fd, 0); - if (map->data == NULL) { + if (map->data == MAP_FAILED) { close (map->fd); free (map); return NULL; -- 1.9.0.rc1.175.g0b1dcb5