Bug Fix: Fix potential memory leak
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
4f1a794065
commit
9b7ff4d663
1 changed files with 3 additions and 1 deletions
|
@ -756,8 +756,10 @@ static int load_twosf_mapz(struct twosf_loader_state *state, int issave, const u
|
||||||
|
|
||||||
{
|
{
|
||||||
uLong ccrc = crc32(crc32(0L, Z_NULL, 0), rdata, (uInt)usize);
|
uLong ccrc = crc32(crc32(0L, Z_NULL, 0), rdata, (uInt)usize);
|
||||||
if(ccrc != zcrc)
|
if(ccrc != zcrc) {
|
||||||
|
free(rdata);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = load_twosf_map(state, issave, rdata, (unsigned)usize);
|
ret = load_twosf_map(state, issave, rdata, (unsigned)usize);
|
||||||
|
|
Loading…
Reference in a new issue