mesa: check for posix_memalign() errors

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit b1097607db)
This commit is contained in:
Brian Paul 2010-11-29 09:21:26 -07:00
parent 9d644e7b95
commit aa7bf2d88e

View file

@ -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);