From ba089cfa823e991ea53f62d61d087084a8e7381e Mon Sep 17 00:00:00 2001 From: Juha-Pekka Heikkila Date: Fri, 1 Aug 2014 14:38:17 +0300 Subject: i965: Add extra null check in intel_bufferobj_alloc() Check calloc returned requested memory. Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Anuj Phogat --- src/mesa/drivers/dri/i965/intel_buffer_objects.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v1.2.3