From 00f3c7baeb3e8f00ce7bc8a1384ef545e648f1d9 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Tue, 5 May 2015 19:05:30 -0700 Subject: [PATCH] i965/sync: Return NULL when calloc fails Reviewed-by: Daniel Stone Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/intel_syncobj.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/i965/intel_syncobj.c b/src/mesa/drivers/dri/i965/intel_syncobj.c index 3bc32dfa3ee..a425b9eefd7 100644 --- a/src/mesa/drivers/dri/i965/intel_syncobj.c +++ b/src/mesa/drivers/dri/i965/intel_syncobj.c @@ -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; } -- 2.30.2