From ea1e50cc166ae855f9fa91ca6a4f944123298e4e Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Thu, 30 Aug 2018 19:02:45 +0300 Subject: [PATCH] u_vbuf: Fix leak MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported by Coverity: data is heap-allocated, but only freed in the info->index_size != 0 branch. Signed-off-by: Ernestas Kulik Signed-off-by: Marek Olšák Cc: 18.2 --- 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 a7a8a3b..f721613 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.7.4