mirror of https://github.com/snes9xgit/snes9x.git
Remove memory leak in loadzip.cpp
* Call `unzClose(file)` outside of the assert clause. In Release mode, any statement in an assert clause is not called, causing a memory leak. If the file does not close successfully, `assert(FAIL)` is called.
This commit is contained in:
parent
b5b7c4390c
commit
6591ee92a2
|
@ -257,7 +257,8 @@ bool8 LoadZip (const char *zipname, uint32 *TotalFileSize, uint8 *buffer)
|
|||
if (!(port == UNZ_END_OF_LIST_OF_FILE || port == UNZ_OK) || filesize == 0 ||
|
||||
(len > 5 && strcasecmp(zipname + len - 5, ".msu1") == 0 && strcasecmp(filename, "program.rom") != 0))
|
||||
{
|
||||
assert(unzClose(file) == UNZ_OK);
|
||||
if (unzClose(file) != UNZ_OK)
|
||||
assert(FALSE);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue