i965/sync: Return NULL when calloc fails
authorChad Versace <chad.versace@intel.com>
Wed, 6 May 2015 02:05:30 +0000 (19:05 -0700)
committerChad Versace <chad.versace@intel.com>
Thu, 7 May 2015 15:11:21 +0000 (08:11 -0700)
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/intel_syncobj.c

index 3bc32dfa3eed4d0f8e24a37b2a476b35a4434481..a425b9eefd758dcfa5fb2e62e864047ccb8080c4 100644 (file)
@@ -50,6 +50,8 @@ intel_new_sync_object(struct gl_context *ctx, GLuint id)
    struct intel_sync_object *sync;
 
    sync = calloc(1, sizeof(struct intel_sync_object));
+   if (!sync)
+      return NULL;
 
    return &sync->Base;
 }