Andrew Talbot : winhelp: Fix a memory leak.
Module: wine Branch: master Commit: da5a398cc3f4b4775715cee450551ee6bfa89764 URL: http://source.winehq.org/git/wine.git/?a=commit;h=da5a398cc3f4b4775715cee450... Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Tue Oct 23 18:55:31 2007 +0100 winhelp: Fix a memory leak. --- programs/winhelp/hlpfile.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/programs/winhelp/hlpfile.c b/programs/winhelp/hlpfile.c index 417148e..8882a1a 100644 --- a/programs/winhelp/hlpfile.c +++ b/programs/winhelp/hlpfile.c @@ -580,7 +580,11 @@ static BYTE* HLPFILE_DecompressGfx(BYTE* src, unsigned csz, unsigned sz, BYTE if (!tmp) return FALSE; HLPFILE_UncompressLZ77(src, src + csz, tmp); dst = tmp2 = HeapAlloc(GetProcessHeap(), 0, sz); - if (!dst) return FALSE; + if (!dst) + { + HeapFree(GetProcessHeap(), 0, tmp); + return FALSE; + } HLPFILE_UncompressRLE(tmp, tmp + sz77, &tmp2, sz); if (tmp2 - dst != sz) WINE_WARN("Bogus gfx sizes (LZ77+RunLen): %u / %u\n", tmp2 - dst, sz);
participants (1)
-
Alexandre Julliard