summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <[email protected]>2014-02-26 16:32:14 +0200
committerTapani Pälli <[email protected]>2014-09-23 10:25:02 +0300
commit6e56eaf7b719b0635d605802b5b9e837b776291b (patch)
treefdd3dd59933a5e1460fd22a92ff7c5d13e153aaf /src/glsl/link_varyings.cpp
parenta82b29d52627c0b0a35efa437c4d81aaaafbbe0c (diff)
glsl: add missing null check in tfeedback_decl::init()
Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/glsl/link_varyings.cpp')
-rw-r--r--src/glsl/link_varyings.cpp5
1 files changed, 5 insertions, 0 deletions
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;