From: Juha-Pekka Heikkila Date: Wed, 26 Feb 2014 14:32:14 +0000 (+0200) Subject: glsl: add missing null check in tfeedback_decl::init() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6e56eaf7b719b0635d605802b5b9e837b776291b;p=mesa.git glsl: add missing null check in tfeedback_decl::init() Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Anuj Phogat --- diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp index 54ceae1b9eb..a738e2f3825 100644 --- a/src/glsl/link_varyings.cpp +++ b/src/glsl/link_varyings.cpp @@ -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;