[igt-dev] [i-g-t] tests/kms_color: Fix memory leaks

Kamil Konieczny kamil.konieczny at linux.intel.com
Wed Jul 6 08:35:25 UTC 2022


Hi Bhanuprakash,

On 2022-07-06 at 09:18:46 +0530, Bhanuprakash Modem wrote:
> Free allocated memory before return.
> 
> Fixes: d61e4598
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
> ---
>  tests/kms_color.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c
> index 0b03fb9a..a9d55d44 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -427,13 +427,14 @@ static bool test_pipe_legacy_gamma_reset(data_t *data,
>  			   lut[i].blue == 0xffff);
>  	drmModeFreePropertyBlob(blob);

There are malloc for red_lut and two others, imho they should be
cleaned up before end: label.

>  
> +end:
>  	igt_plane_set_fb(primary, NULL);
>  	igt_output_set_pipe(output, PIPE_NONE);
>  	igt_display_commit(&data->display);
>  
>  	free_lut(degamma_linear);
>  	free_lut(gamma_zero);
> -end:
> +

Remove this empty line.

Regards,
Kamil

>  	return ret;
>  }
>  
> -- 
> 2.35.1
> 


More information about the igt-dev mailing list