[Mesa-dev] [PATCH 2/4] mesa: check allocation failures in new_transform_feedback()

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Aug 24 11:43:19 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 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 9ffbfe7e6c..e30448ea4f 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.14.1



More information about the mesa-dev mailing list