mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-19 19:50:24 +01:00
glsl: Fix memory leak in builtin_builder::_image_prototype.
in_var calls the ir_variable constructor, which dups the variable name. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
parent
f4b4ae8c24
commit
db8cd4d519
1 changed files with 5 additions and 3 deletions
|
|
@ -4465,9 +4465,11 @@ builtin_builder::_image_prototype(const glsl_type *image_type,
|
|||
sig->parameters.push_tail(in_var(glsl_type::int_type, "sample"));
|
||||
|
||||
/* Data arguments. */
|
||||
for (unsigned i = 0; i < num_arguments; ++i)
|
||||
sig->parameters.push_tail(in_var(data_type,
|
||||
ralloc_asprintf(NULL, "arg%d", i)));
|
||||
for (unsigned i = 0; i < num_arguments; ++i) {
|
||||
char *arg_name = ralloc_asprintf(NULL, "arg%d", i);
|
||||
sig->parameters.push_tail(in_var(data_type, arg_name));
|
||||
ralloc_free(arg_name);
|
||||
}
|
||||
|
||||
/* Set the maximal set of qualifiers allowed for this image
|
||||
* built-in. Function calls with arguments having fewer
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue