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>
This commit is contained in:
@@ -2439,11 +2439,13 @@ check_explicit_uniform_locations(struct gl_context *ctx,
|
|||||||
ir_variable *var = node->as_variable();
|
ir_variable *var = node->as_variable();
|
||||||
if ((var && var->data.mode == ir_var_uniform) &&
|
if ((var && var->data.mode == ir_var_uniform) &&
|
||||||
var->data.explicit_location) {
|
var->data.explicit_location) {
|
||||||
if (!reserve_explicit_locations(prog, uniform_map, var))
|
if (!reserve_explicit_locations(prog, uniform_map, var)) {
|
||||||
|
delete uniform_map;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delete uniform_map;
|
delete uniform_map;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user