From 549c30d55658c80e6bdc5359f028ff231e500cf1 Mon Sep 17 00:00:00 2001 From: otto Date: Tue, 12 Sep 2017 18:36:30 +0000 Subject: mapalign returns MAP_FAILED for failuer; from George Koehler --- lib/libc/stdlib/malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/stdlib/malloc.c') 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 * Copyright (c) 2012 Matthew Dempsky @@ -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; } -- cgit v1.2.3-59-g8ed1b