[vlc-devel] [PATCH 3/3] vout/opengl: fix leak if program check fails

Thomas Guillem thomas at gllm.fr
Thu Dec 8 13:15:05 CET 2016


---
 modules/video_output/opengl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index d9ef274..c80424a 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -705,7 +705,8 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
         vgl->GetProgramiv(vgl->program[i], GL_LINK_STATUS, &link_status);
         if (link_status == GL_FALSE) {
             fprintf(stderr, "Unable to use program %d\n", i);
-            free(vgl);
+            vlc_gl_Unlock(vgl->gl);
+            vout_display_opengl_Delete(vgl);
             return NULL;
         }
     }
-- 
2.10.2



More information about the vlc-devel mailing list