Check for out of memory when creating fence
authorAlan Hourihane <alanh@vmware.com>
Sat, 26 Feb 2011 10:30:19 +0000 (10:30 +0000)
committerAlan Hourihane <alanh@vmware.com>
Sat, 26 Feb 2011 10:30:19 +0000 (10:30 +0000)
src/gallium/drivers/llvmpipe/lp_fence.c

index 3a55e76bc3558e6df028bf368e036f14404edd10..a21a3c744844c37a2a5106d160f455f474cdd9ae 100644 (file)
@@ -47,6 +47,9 @@ lp_fence_create(unsigned rank)
    static int fence_id;
    struct lp_fence *fence = CALLOC_STRUCT(lp_fence);
 
+   if (!fence)
+      return NULL;
+
    pipe_reference_init(&fence->reference, 1);
 
    pipe_mutex_init(fence->mutex);