From: Samuel Pitoiset Date: Thu, 24 Aug 2017 11:43:19 +0000 (+0200) Subject: mesa: check allocation failures in new_transform_feedback() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=41c7c2d968961e1cca2d5308f3066b2b840be68b;p=mesa.git mesa: check allocation failures in new_transform_feedback() Signed-off-by: Samuel Pitoiset Reviewed-by: Timothy Arceri --- 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; }