Skip to content

Commit

Permalink
GOB: Plug a leak
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Mar 20, 2013
1 parent 19d9071 commit 0de198c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion engines/gob/cmpfile.cpp
Expand Up @@ -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);

Expand Down

0 comments on commit 0de198c

Please sign in to comment.