From: Juha-Pekka Heikkila Date: Fri, 1 Aug 2014 11:38:17 +0000 (+0300) Subject: i965: Add extra null check in intel_bufferobj_alloc() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ba089cfa823e991ea53f62d61d087084a8e7381e;p=mesa.git i965: Add extra null check in intel_bufferobj_alloc() Check calloc returned requested memory. Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Anuj Phogat --- diff --git a/src/mesa/drivers/dri/i965/intel_buffer_objects.c b/src/mesa/drivers/dri/i965/intel_buffer_objects.c index 96dacde04fb..0e19e465c4c 100644 --- a/src/mesa/drivers/dri/i965/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/i965/intel_buffer_objects.c @@ -136,6 +136,9 @@ static struct gl_buffer_object * intel_bufferobj_alloc(struct gl_context * ctx, GLuint name, GLenum target) { struct intel_buffer_object *obj = CALLOC_STRUCT(intel_buffer_object); + if (!obj) { + _mesa_error_no_memory(__func__); + } _mesa_initialize_buffer_object(ctx, &obj->Base, name, target);