[Mesa-dev] [PATCH] meta: Plug memory leak in blit shader creation

Ben Widawsky benjamin.widawsky at intel.com
Fri Mar 6 18:22:00 PST 2015


It looks like this has existed since:
commit f5a477ab76b6e0b268387699cd2253a43db0dfae
Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Dec 16 11:54:08 2013 -0800

    meta: Refactor shader generation code out of mipmap generation path

Valgrind was complaining on the piglit test:
fbo-generatemipmap-formats GL_ARB_texture_float -auto -fbo

Cc: Ian Romanick <ian.d.romanick at intel.com>
Cc: Brian Paul <brianp at vmware.com>
Cc: Eric Anholt <eric at anholt.net>
Reported-by: Mark Janes <mark.a.janes at intel.com> (Jenkins)
Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 src/mesa/drivers/common/meta.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index fdc4cf1..2c1abe3 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -270,6 +270,7 @@ _mesa_meta_setup_blit_shader(struct gl_context *ctx,
 
    if (shader->shader_prog != 0) {
       _mesa_UseProgram(shader->shader_prog);
+      ralloc_free(mem_ctx);
       return;
    }
 
-- 
2.3.1



More information about the mesa-dev mailing list