[Mesa-dev] [PATCH 2/4] u_vbuf: Fix leak

Marek Olšák maraeo at gmail.com
Tue Sep 4 17:56:53 UTC 2018


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Aug 30, 2018 at 12:02 PM, Ernestas Kulik
<ernestas.kulik at gmail.com> wrote:
> Reported by Coverity: data is heap-allocated, but only freed in the
> info->index_size != 0 branch.
>
> CID: 1438238
> Signed-off-by: Ernestas Kulik <ernestas.kulik at gmail.com>
> ---
>  src/gallium/auxiliary/util/u_vbuf.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
> index a7a8a3be21..f721613cbc 100644
> --- a/src/gallium/auxiliary/util/u_vbuf.c
> +++ b/src/gallium/auxiliary/util/u_vbuf.c
> @@ -1334,6 +1334,7 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info)
>              end_vertex = MAX2(end_vertex, start + count);
>              end_instance = MAX2(end_instance, start_instance + instance_count);
>           }
> +         free(data);
>
>           /* Set the final counts. */
>           new_info.count = end_vertex - new_info.start;
> --
> 2.17.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