SCUMM: Fix potential memory leak. CID 1003586

This commit is contained in:
Eugene Sandulenko 2013-11-03 01:27:21 +02:00
parent 69ac3bb944
commit 2362498d54

View File

@ -443,11 +443,13 @@ ImuseDigiSndMgr::SoundDesc *ImuseDigiSndMgr::openSound(int32 soundId, const char
} else if (soundName[0] == 0) {
if (sound->bundle->decompressSampleByIndex(soundId, 0, 0x2000, &ptr, 0, header_outside) == 0 || ptr == NULL) {
closeSound(sound);
free(ptr);
return NULL;
}
} else {
if (sound->bundle->decompressSampleByName(soundName, 0, 0x2000, &ptr, header_outside) == 0 || ptr == NULL) {
closeSound(sound);
free(ptr);
return NULL;
}
}