[Mesa-dev] [PATCH 1/1] Avoid leaking parameter name in prog_to_nir.
Matthias Lorenz
oschowa at web.de
Thu Feb 21 09:09:06 UTC 2019
Fixes: 3d7611e9 "st/nir: use NIR for asm programs"
---
src/mesa/program/prog_to_nir.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c
index 312b299361e..6e3fa9432a3 100644
--- a/src/mesa/program/prog_to_nir.c
+++ b/src/mesa/program/prog_to_nir.c
@@ -1024,7 +1024,8 @@ prog_to_nir(const struct gl_program *prog,
c->parameters = rzalloc(s, nir_variable);
c->parameters->type =
glsl_array_type(glsl_vec4_type(), prog->Parameters->NumParameters, 0);
- c->parameters->name = strdup(prog->Parameters->Parameters[0].Name);
+ c->parameters->name =
+ ralloc_strdup(c->parameters, prog->Parameters->Parameters[0].Name);
c->parameters->data.read_only = true;
c->parameters->data.mode = nir_var_uniform;
exec_list_push_tail(&s->uniforms, &c->parameters->node);
--
2.20.1
More information about the mesa-dev
mailing list