mesa: check allocation failures in new_transform_feedback()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 24 Aug 2017 11:43:19 +0000 (13:43 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 25 Aug 2017 09:11:44 +0000 (11:11 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/main/transformfeedback.c

index 9ffbfe7e6c679166527c32c1ef8284e7694cfcc2..e30448ea4f63ca06ca0801b24d5e44d7865599ab 100644 (file)
@@ -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;
 }