summaryrefslogtreecommitdiff
path: root/src/glsl/linker.cpp
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-09-02 09:54:36 +1000
committerDave Airlie <airlied@redhat.com>2014-09-02 16:05:52 +1000
commit2d5d1f55983f645df97f0b44ab95235d30faa7bf (patch)
tree053f82e986ca004ae25a89d891dcf168ca2c5373 /src/glsl/linker.cpp
parent9f2050365851c61f21f83ce60bc628a3e192e1dc (diff)
glsl: free uniform_map on failure path.
If we fails in reserve_explicit_locations, we leak uniform_map. Reported-by: coverity scanner. Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r--src/glsl/linker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index d5473adc36..57be4931d7 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2439,8 +2439,10 @@ check_explicit_uniform_locations(struct gl_context *ctx,
ir_variable *var = node->as_variable();
if ((var && var->data.mode == ir_var_uniform) &&
var->data.explicit_location) {
- if (!reserve_explicit_locations(prog, uniform_map, var))
+ if (!reserve_explicit_locations(prog, uniform_map, var)) {
+ delete uniform_map;
return;
+ }
}
}
}