From 19b5a82fdafd583317265e86fd13c23e52839131 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Tue, 5 May 2015 19:05:31 -0700 Subject: i915/sync: Return early when calloc fails Reviewed-by: Daniel Stone Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i915/intel_syncobj.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i915/intel_syncobj.c b/src/mesa/drivers/dri/i915/intel_syncobj.c index 92a246dfdae..92b5b636891 100644 --- a/src/mesa/drivers/dri/i915/intel_syncobj.c +++ b/src/mesa/drivers/dri/i915/intel_syncobj.c @@ -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; } -- cgit v1.2.3