From 6a73ddfcccf46cdc7dafe8345fdd7e964cf2c8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 18 Jan 2016 23:10:53 +0100 Subject: [PATCH] renderer: fix some vrend_sub_context leaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix leaks found thanks to AddressSanitizer. Signed-off-by: Marc-André Lureau --- src/vrend_renderer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index df76637..44abd60 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -3788,6 +3788,10 @@ static void vrend_destroy_sub_context(struct vrend_sub_context *sub) vrend_shader_state_reference(&sub->shaders[PIPE_SHADER_GEOMETRY], NULL); vrend_free_programs(sub); + for (i = 0; i < PIPE_SHADER_TYPES; i++) { + free(sub->consts[i].consts); + sub->consts[i].consts = NULL; + } vrend_object_fini_ctx_table(sub->object_hash); vrend_clicbs->destroy_gl_context(sub->gl_context);