From 0c0847160d77e91159d637919f2eeae625a7a99d Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Sun, 30 Aug 2015 22:57:29 +0100 Subject: [PATCH] fix #1857 --- src/ride/track.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ride/track.c b/src/ride/track.c index 6994cb371d..606348fd1c 100644 --- a/src/ride/track.c +++ b/src/ride/track.c @@ -322,12 +322,14 @@ static uint8* track_list_cache_load(int totalFiles) SDL_RWread(file, &fileCount, 4, 1); if (fileCount != totalFiles){ + SDL_RWclose(file); log_verbose("Track file count is different."); return 0; } track_list_cache = malloc(track_list_size); SDL_RWread(file, track_list_cache, track_list_size, 1); + SDL_RWclose(file); return track_list_cache; }