glsl: add missing null check in tfeedback_decl::init()
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Wed, 26 Feb 2014 14:32:14 +0000 (16:32 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Tue, 23 Sep 2014 07:25:02 +0000 (10:25 +0300)
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/glsl/link_varyings.cpp

index 54ceae1b9ebaaece68171122794e6ac2db23d95d..a738e2f382583f5b82aa10b035bbdd90239fa30b 100644 (file)
@@ -318,6 +318,11 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx,
    const char *base_name_end;
    long subscript = parse_program_resource_name(input, &base_name_end);
    this->var_name = ralloc_strndup(mem_ctx, input, base_name_end - input);
+   if (this->var_name == NULL) {
+      _mesa_error_no_memory(__func__);
+      return;
+   }
+
    if (subscript >= 0) {
       this->array_subscript = subscript;
       this->is_subscripted = true;