From: Chad Versace Date: Wed, 6 May 2015 02:05:30 +0000 (-0700) Subject: i965/sync: Return NULL when calloc fails X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00f3c7baeb3e8f00ce7bc8a1384ef545e648f1d9;p=mesa.git i965/sync: Return NULL when calloc fails Reviewed-by: Daniel Stone Reviewed-by: Kenneth Graunke --- 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; }