From 7f149136ca26ee8d94c4c3060a8fbd842f3934ad Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 28 Apr 2020 11:56:22 +0200 Subject: [PATCH] SLUDGE: Plug memory leak --- engines/sludge/builtin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engines/sludge/builtin.cpp b/engines/sludge/builtin.cpp index 05fdc20889a..15cb48a40ae 100644 --- a/engines/sludge/builtin.cpp +++ b/engines/sludge/builtin.cpp @@ -842,8 +842,10 @@ builtIn(anim) { // Load the required sprite bank LoadedSpriteBank *sprBanky = g_sludge->_gfxMan->loadBankForAnim(fileNumber); - if (!sprBanky) + if (!sprBanky) { + delete ba; return BR_ERROR; // File not found, fatal done already + } ba->theSprites = sprBanky; // Return value