From 0de198c9972ea39be93b48bd49e98bf499edc441 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Wed, 20 Mar 2013 08:28:45 +0100 Subject: GOB: Plug a leak --- engines/gob/cmpfile.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/gob') diff --git a/engines/gob/cmpfile.cpp b/engines/gob/cmpfile.cpp index d304958f76..0c650a917e 100644 --- a/engines/gob/cmpfile.cpp +++ b/engines/gob/cmpfile.cpp @@ -135,8 +135,11 @@ void CMPFile::loadCMP(Common::SeekableReadStream &cmp) { uint32 size = cmp.size(); byte *data = new byte[size]; - if (cmp.read(data, size) != size) + if (cmp.read(data, size) != size) { + delete[] data; + return; + } _vm->_video->drawPackedSprite(data, _surface->getWidth(), _surface->getHeight(), 0, 0, 0, *_surface); -- cgit v1.2.3