Fixed bug 3855 - Memory leak in SDL_FreeSurface
diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c
index 75b699c..cabe7e0 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);
}