From cdfce09fb7b8b52135e284e6afd04e57977d1e9b Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Tue, 8 Apr 2014 15:54:01 +0100 Subject: [PATCH] gl: fix leaks As the relevant variables are initialized to 0/NULL, we can loop over the full range and make sure we free partial allocations when an error happens partway through initialization. --- gst-libs/gst/gl/egl/gsteglimagememory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/egl/gsteglimagememory.c b/gst-libs/gst/gl/egl/gsteglimagememory.c index 90f6219da2..760f48e53e 100644 --- a/gst-libs/gst/gl/egl/gsteglimagememory.c +++ b/gst-libs/gst/gl/egl/gsteglimagememory.c @@ -556,7 +556,7 @@ mem_error: { GST_ERROR_OBJECT (GST_CAT_DEFAULT, "Failed to create EGLImage"); - for (i = 0; i < n_mem; i++) { + for (i = 0; i < 3; i++) { if (client_buffer_tex[i]) gst_gl_context_del_texture (ctx, (GLuint *) & client_buffer_tex[i]); if (mem[i])