diff options
author | 2009-10-20 21:19:37 +0000 | |
---|---|---|
committer | 2009-10-20 21:19:37 +0000 | |
commit | c1559ed6d6ea984050fc6cef34645f18a148aeac (patch) | |
tree | a06ca4c319e0ecb2f773fc89ed3c05d838b355fd /lib/libc/stdlib/malloc.c | |
parent | Try to reduce the UTF-8 mess. (diff) | |
download | wireguard-openbsd-c1559ed6d6ea984050fc6cef34645f18a148aeac.tar.xz wireguard-openbsd-c1559ed6d6ea984050fc6cef34645f18a148aeac.zip |
Check mmap return value against MAP_FAILED not NULL.
Okay deraadt@, otto@.
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index a94e362ceb2..9e58d2d964a 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.116 2009/06/08 19:21:08 deraadt Exp $ */ +/* $OpenBSD: malloc.c,v 1.117 2009/10/20 21:19:37 pirofti Exp $ */ /* * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net> * @@ -696,7 +696,7 @@ omalloc_init(struct dir_info **dp) * randomise offset inside the page at which the dir_info * lies (subject to alignment by 1 << MALLOC_MINSHIFT) */ - if ((p = MMAP(DIR_INFO_RSZ + (MALLOC_PAGESIZE * 2))) == NULL) + if ((p = MMAP(DIR_INFO_RSZ + (MALLOC_PAGESIZE * 2))) == MAP_FAILED) return -1; mprotect(p, MALLOC_PAGESIZE, PROT_NONE); mprotect(p + MALLOC_PAGESIZE + DIR_INFO_RSZ, |