Fixed bug 2699 - possible memory leak in GL_RenderReadPixels
authorSam Lantinga <slouken@libsdl.org>
Sun, 24 Aug 2014 00:02:12 -0700
changeset 911592ca74200ea5
parent 9114 515603c105ab
child 9117 236241f5d225
Fixed bug 2699 - possible memory leak in GL_RenderReadPixels

Benoit Pierre

If glReadPixels returns an error, than the temporary buffer is not deallocated
src/render/opengl/SDL_render_gl.c
     1.1 --- a/src/render/opengl/SDL_render_gl.c	Sat Aug 23 19:06:54 2014 -0700
     1.2 +++ b/src/render/opengl/SDL_render_gl.c	Sun Aug 24 00:02:12 2014 -0700
     1.3 @@ -1429,6 +1429,7 @@
     1.4                         format, type, temp_pixels);
     1.5  
     1.6      if (GL_CheckError("glReadPixels()", renderer) < 0) {
     1.7 +        SDL_free(temp_pixels);
     1.8          return -1;
     1.9      }
    1.10