aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2011-11-01 15:56:22 +0100
committerJohannes Schickel2011-11-01 16:04:02 +0100
commita0da684bc5f280656dc527e04d563a82fbd4ae5a (patch)
tree8722df18c5931c107a003ea908fb5e1f3539dada /engines
parent21260b35c6b5c526994990959160b35041c26bdc (diff)
downloadscummvm-rg350-a0da684bc5f280656dc527e04d563a82fbd4ae5a.tar.gz
scummvm-rg350-a0da684bc5f280656dc527e04d563a82fbd4ae5a.tar.bz2
scummvm-rg350-a0da684bc5f280656dc527e04d563a82fbd4ae5a.zip
SCUMM: Fix possible leak in Player_V2A code.
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/player_v2a.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/scumm/player_v2a.cpp b/engines/scumm/player_v2a.cpp
index ed97c4098f..618ebaaeaf 100644
--- a/engines/scumm/player_v2a.cpp
+++ b/engines/scumm/player_v2a.cpp
@@ -1914,8 +1914,10 @@ void Player_V2A::startSound(int nr) {
}
stopSound(nr);
int i = getSoundSlot();
- if (i == -1)
+ if (i == -1) {
+ delete snd;
return;
+ }
_slot[i].id = nr;
_slot[i].sound = snd;
_slot[i].sound->start(_mod, nr, data);