summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2017-09-12 18:36:30 +0000
committerotto <otto@openbsd.org>2017-09-12 18:36:30 +0000
commit549c30d55658c80e6bdc5359f028ff231e500cf1 (patch)
treef61a41e24f29bb345664af588673997c35add5b6 /lib/libc/stdlib/malloc.c
parentDo not segfault when there are two .Dt macros, the first without (diff)
downloadwireguard-openbsd-549c30d55658c80e6bdc5359f028ff231e500cf1.tar.xz
wireguard-openbsd-549c30d55658c80e6bdc5359f028ff231e500cf1.zip
mapalign returns MAP_FAILED for failuer; from George Koehler
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r--lib/libc/stdlib/malloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 1914f906458..e522e0aee53 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.230 2017/09/11 18:32:31 otto Exp $ */
+/* $OpenBSD: malloc.c,v 1.231 2017/09/12 18:36:30 otto Exp $ */
/*
* Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@@ -2000,7 +2000,7 @@ omemalign(struct dir_info *pool, size_t alignment, size_t sz, int zero_fill,
psz = PAGEROUND(sz);
p = mapalign(pool, alignment, psz, zero_fill);
- if (p == NULL) {
+ if (p == MAP_FAILED) {
errno = ENOMEM;
return NULL;
}