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; }