[Mesa-dev] [PATCH 2/2] st/shader_cache: Fix memory leak
Brian Paul
brian.e.paul at gmail.com
Mon Apr 3 03:50:41 UTC 2017
On Sun, Apr 2, 2017 at 11:31 AM, Bartosz Tomczyk <
bartosz.tomczyk86 at gmail.com> wrote:
> ---
> src/mesa/state_tracker/st_shader_cache.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_shader_cache.c
> b/src/mesa/state_tracker/st_shader_cache.c
> index e8c7289ec6..5dbcb74f73 100644
> --- a/src/mesa/state_tracker/st_shader_cache.c
> +++ b/src/mesa/state_tracker/st_shader_cache.c
> @@ -135,6 +135,8 @@ st_store_tgsi_in_disk_cache(struct st_context *st,
> struct gl_program *prog,
> _mesa_shader_stage_to_string(prog->info.stage), sha1_buf);
> }
>
> + if(blob->data)
> + free(blob->data);
>
free() should accept NULL, so the conditional shouldn't be needed.
-Brian
> free(blob);
> }
>
> --
> 2.12.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170402/a76c2aaa/attachment.html>
More information about the mesa-dev
mailing list