Skip to content

Commit

Permalink
SWORD2: Fix (unlikely) memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
wjp committed Apr 22, 2013
1 parent 3943d34 commit 22d8fe9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion engines/sword2/sprite.cpp
Expand Up @@ -590,8 +590,11 @@ int32 Screen::drawSprite(SpriteInfo *s) {
s->w = (decompData / (s->h / 2));
sprite = (byte *)malloc(s->w * s->h);

if (!sprite)
if (!sprite) {
free(tempBuf);

return RDERR_OUTOFMEMORY;
}

resizePsxSprite(sprite, tempBuf, s->w, s->h);
free(tempBuf);
Expand Down

0 comments on commit 22d8fe9

Please sign in to comment.