[virglrenderer-devel] [PATCH virglrenderer] Fix potential leak in fill_interpolants()

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Wed Feb 17 20:56:44 UTC 2016


From: Marc-André Lureau <marcandre.lureau at redhat.com>

Fix found thanks to AddressSanitizer & piglit
glsl-1.50/execution/built-in-functions/gs-pow-vec3-vec3.shader_test.

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 src/vrend_shader.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index a588a29..0389f3f 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -2258,6 +2258,7 @@ static boolean fill_interpolants(struct dump_ctx *ctx, struct vrend_shader_info
    if (ctx->prog_type == TGSI_PROCESSOR_VERTEX || ctx->prog_type == TGSI_PROCESSOR_GEOMETRY)
       return TRUE;
 
+   free(sinfo->interpinfo);
    sinfo->interpinfo = calloc(ctx->num_interps, sizeof(struct vrend_interp_info));
    if (!sinfo->interpinfo)
       return FALSE;
-- 
2.5.0



More information about the virglrenderer-devel mailing list