diff options
author | Eugene Sandulenko | 2013-11-03 01:27:21 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2013-11-03 01:28:03 +0200 |
commit | 2362498d54af2764465beb1d5e2fac77395ccbf0 (patch) | |
tree | 22362b31e057f54ffb923a9e43aeb0fa6c729cca | |
parent | 69ac3bb944196aeffe0c62d0862cd00505f1e98c (diff) | |
download | scummvm-rg350-2362498d54af2764465beb1d5e2fac77395ccbf0.tar.gz scummvm-rg350-2362498d54af2764465beb1d5e2fac77395ccbf0.tar.bz2 scummvm-rg350-2362498d54af2764465beb1d5e2fac77395ccbf0.zip |
SCUMM: Fix potential memory leak. CID 1003586
-rw-r--r-- | engines/scumm/imuse_digi/dimuse_sndmgr.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp index af4f8775f4..26e248fbca 100644 --- a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp +++ b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp @@ -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; } } |