From 05cff7923c00929f241ebd8d580f1250e1f73bee Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 24 Aug 2014 00:02:12 -0700 Subject: [PATCH] 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 file changed, 1 insertion(+) diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index c43739ec8..ecd0d531f 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1429,6 +1429,7 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, format, type, temp_pixels); if (GL_CheckError("glReadPixels()", renderer) < 0) { + SDL_free(temp_pixels); return -1; }