From db20e71d546ef7cd38652893befa742867278af5 Mon Sep 17 00:00:00 2001 From: Brandon Schaefer Date: Mon, 2 Oct 2017 10:50:33 -0700 Subject: [PATCH] Fixed bug 3855 - Memory leak in SDL_FreeSurface --- src/video/SDL_surface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 75b699c3a..cabe7e093 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -1217,6 +1217,9 @@ SDL_FreeSurface(SDL_Surface * surface) if (!(surface->flags & SDL_PREALLOC)) { SDL_free(surface->pixels); } + if (surface->map) { + SDL_FreeBlitMap(surface->map); + } SDL_free(surface); }