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.
This commit is contained in:
Vincent Penquerc'h 2014-04-08 15:54:01 +01:00 committed by Tim-Philipp Müller
parent 4ecffcf76b
commit 7de81a33ca

View file

@ -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])