From: José Fonseca Date: Thu, 14 Aug 2008 08:44:49 +0000 (+0100) Subject: gallium: Catch errors from posix_memalign. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8540ef9fb22bbedc788c374fda3354047df110f;p=mesa.git gallium: Catch errors from posix_memalign. --- diff --git a/src/gallium/include/pipe/p_util.h b/src/gallium/include/pipe/p_util.h index eec413842fb..4e1a996122d 100644 --- a/src/gallium/include/pipe/p_util.h +++ b/src/gallium/include/pipe/p_util.h @@ -213,7 +213,8 @@ align_malloc(size_t bytes, uint alignment) { #if defined(HAVE_POSIX_MEMALIGN) void *mem; - (void) posix_memalign(& mem, alignment, bytes); + if(posix_memalign(& mem, alignment, bytes) != 0) + return NULL; return mem; #else char *ptr, *buf;