From: pontus lidman Date: Mon, 29 Nov 2010 16:20:41 +0000 (-0700) Subject: mesa: check for posix_memalign() errors X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b1097607db58ddaa91281e364dbb4aa53d904052;p=mesa.git mesa: check for posix_memalign() errors Signed-off-by: Brian Paul --- diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index bcca4edc1aa..cefbf4d8c98 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);