gallium: Catch errors from posix_memalign.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Thu, 14 Aug 2008 08:44:49 +0000 (09:44 +0100)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Thu, 14 Aug 2008 10:01:42 +0000 (11:01 +0100)
src/gallium/include/pipe/p_util.h

index eec413842fbca8db0fe8ad03fdd1eb13fbe4941d..4e1a996122d21f11481c63bd5b1d1153185655f0 100644 (file)
@@ -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;