From a2f12a1b0f95b13b6f8dc3d05d7b74b4386394e4 Mon Sep 17 00:00:00 2001 From: Li Qiang Date: Sat, 7 Jan 2017 01:24:21 -0500 Subject: [PATCH] renderer: fix memory leak in add shader program Free 'sprog' in error path to avoid memory leak. Signed-off-by: Li Qiang Signed-off-by: Dave Airlie --- src/vrend_renderer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 32e2e7d..ad68f71 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -892,6 +892,7 @@ static struct vrend_linked_shader_program *add_shader_program(struct vrend_conte fprintf(stderr,"geom shader: %d GLSL\n%s\n", gs->id, gs->glsl_prog); fprintf(stderr,"frag shader: %d GLSL\n%s\n", fs->id, fs->glsl_prog); glDeleteProgram(prog_id); + free(sprog); return NULL; }