summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2014-09-02 09:54:36 +1000
committerDave Airlie <[email protected]>2014-09-02 16:05:52 +1000
commit2d5d1f55983f645df97f0b44ab95235d30faa7bf (patch)
tree053f82e986ca004ae25a89d891dcf168ca2c5373 /src
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 <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-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 d5473adc36e..57be4931d78 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;
+ }
}
}
}