summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-08-26 14:48:22 +0200
committerStef Walter <stef@thewalter.net>2013-08-28 10:55:40 +0200
commite1042e93488f2b38abeea58b65440111df69afdc (patch)
treeb67004bb7897639c391f53628cb71b0978d4a845 /common
parent2978f8fb27681e9f40575ae2be26012e8a54fc71 (diff)
compat: Check return value of mmap() properly
https://bugs.freedesktop.org/show_bug.cgi?id=68525
Diffstat (limited to 'common')
-rw-r--r--common/compat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/compat.c b/common/compat.c
index e7bee3c..d813236 100644
--- a/common/compat.c
+++ b/common/compat.c
@@ -206,7 +206,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 (data == NULL) {
+ if (map->data == NULL) {
close (map->fd);
free (map);
return NULL;