From aa7bf2d88e95bdd1935ced45f90f03a156f995c3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 29 Nov 2010 09:21:26 -0700 Subject: [PATCH] mesa: check for posix_memalign() errors Signed-off-by: Brian Paul (cherry picked from commit b1097607db58ddaa91281e364dbb4aa53d904052) --- src/mesa/main/imports.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 46e5c932d0f..13dabde9303 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -88,7 +88,8 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment) #if defined(HAVE_POSIX_MEMALIGN) void *mem; int err = posix_memalign(& mem, alignment, bytes); - (void) err; + if (err) + return NULL; return mem; #elif defined(_WIN32) && defined(_MSC_VER) return _aligned_malloc(bytes, alignment);