i915/sync: Return early 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:31 -07:00
parent 00f3c7baeb
commit 19b5a82fda
1 changed files with 2 additions and 0 deletions

View File

@ -51,6 +51,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;
}