Mesa (master): i915/sync: Return early when calloc fails

Chad Versace chadversary at kemper.freedesktop.org
Thu May 7 15:13:12 UTC 2015


Module: Mesa
Branch: master
Commit: 19b5a82fdafd583317265e86fd13c23e52839131
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=19b5a82fdafd583317265e86fd13c23e52839131

Author: Chad Versace <chad.versace at intel.com>
Date:   Tue May  5 19:05:31 2015 -0700

i915/sync: Return early when calloc fails

Reviewed-by: Daniel Stone <daniels at collabora.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i915/intel_syncobj.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/drivers/dri/i915/intel_syncobj.c b/src/mesa/drivers/dri/i915/intel_syncobj.c
index 92a246d..92b5b63 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;
 }




More information about the mesa-commit mailing list