diff options
author | Paul Irofti <pirofti@cvs.openbsd.org> | 2009-10-20 21:19:38 +0000 |
---|---|---|
committer | Paul Irofti <pirofti@cvs.openbsd.org> | 2009-10-20 21:19:38 +0000 |
commit | dd966e2f66bf0f3b530215a52db0f3572dc3ddf1 (patch) | |
tree | 8987b93751cbe94e9e87e195509c221775954ebb /lib/libc | |
parent | f6717b832e0d11c83cfc578e4fc369ae21b9ab03 (diff) |
Check mmap return value against MAP_FAILED not NULL.
Okay deraadt@, otto@.
Diffstat (limited to 'lib/libc')
-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, |