[Mesa-dev] [PATCH 1/1] Avoid leaking parameter name in prog_to_nir.

Tapani Pälli tapani.palli at intel.com
Mon Feb 25 09:05:16 UTC 2019


Yep, confirmed that this plugs the leak.

FWIW there seems to be also "Conditional jump or move depends on 
uninitialised value(s)" from valgrind but that is for something different.

Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

On 2/21/19 11:09 AM, Matthias Lorenz wrote:
> 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
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list