i965/sync: Return NULL when calloc fails

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Chad Versace 2015-05-05 19:05:30 -07:00
parent 9cf9a2dec5
commit 00f3c7baeb

View 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;
}