summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-12-19 13:00:51 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-12-19 13:00:51 +0000
commit7f29cd36065471fc0ec53fb8bb5ccda172b2797a (patch)
treecaf471a9baf71be636ca6d0a6108ab7c4b352b36 /lib/libc
parente8a2ac106f8ddd3cba769d8cb1e4fd3f4d8cba06 (diff)
a failed mmap returns MAP_FAILED, not NULL. found while exercising pax
in low-mem conditions; ok dim@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/malloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index ace34c96f67..39951bc9048 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.84 2006/10/24 04:35:30 tedu Exp $ */
+/* $OpenBSD: malloc.c,v 1.85 2006/12/19 13:00:50 otto Exp $ */
/*
* ----------------------------------------------------------------------------
@@ -267,7 +267,7 @@ alloc_pgfree()
if (pgfree_list == NULL) {
p = MMAP(malloc_pagesize);
- if (!p)
+ if (p == MAP_FAILED)
return NULL;
for (i = 0; i < malloc_pagesize / sizeof(*p); i++) {
p[i].next = pgfree_list;
@@ -288,7 +288,7 @@ alloc_pginfo()
if (pginfo_list == NULL) {
p = MMAP(malloc_pagesize);
- if (!p)
+ if (p == MAP_FAILED)
return NULL;
for (i = 0; i < malloc_pagesize / sizeof(*p); i++) {
p[i].next = pginfo_list;