diff --git a/desktop_version/src/SoundSystem.cpp b/desktop_version/src/SoundSystem.cpp index c0233573..e88d0eda 100644 --- a/desktop_version/src/SoundSystem.cpp +++ b/desktop_version/src/SoundSystem.cpp @@ -33,7 +33,7 @@ SoundTrack::SoundTrack(const char* fileName) FILESYSTEM_loadFileToMemory(fileName, &mem, &length); SDL_RWops *fileIn = SDL_RWFromMem(mem, length); sound = Mix_LoadWAV_RW(fileIn, 1); - FILESYSTEM_freeMemory(&mem); + if (length) FILESYSTEM_freeMemory(&mem); if (sound == NULL) {