From 41c7c2d968961e1cca2d5308f3066b2b840be68b Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 24 Aug 2017 13:43:19 +0200 Subject: [PATCH] mesa: check allocation failures in new_transform_feedback() Signed-off-by: Samuel Pitoiset Reviewed-by: Timothy Arceri --- src/mesa/main/transformfeedback.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 9ffbfe7e6c6..e30448ea4f6 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -207,7 +207,11 @@ static struct gl_transform_feedback_object * new_transform_feedback(struct gl_context *ctx, GLuint name) { struct gl_transform_feedback_object *obj; + obj = CALLOC_STRUCT(gl_transform_feedback_object); + if (!obj) + return NULL; + _mesa_init_transform_feedback_object(obj, name); return obj; } -- 2.30.2