From 2d5d1f55983f645df97f0b44ab95235d30faa7bf Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 2 Sep 2014 09:54:36 +1000 Subject: [PATCH] glsl: free uniform_map on failure path. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If we fails in reserve_explicit_locations, we leak uniform_map. Reported-by: coverity scanner. Reviewed-by: Tapani Pälli Signed-off-by: Dave Airlie --- src/glsl/linker.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; + } } } } -- 2.30.2