Fix memory leak in CSO reading.

This commit is contained in:
Unknown W. Brackets committed 2013-02-08 19:27:42 -08:00
1 parent b82feed816
commit 2ea113369b
1 file changed
+3
+3
View File
@@ -165,14 +165,17 @@ bool CISOFileBlockDevice::ReadBlock(int blockNumber, u8 *outPtr)
//if (status != Z_OK)
{
ERROR_LOG(LOADER, "block %d:inflate : %s[%d]\n", blockNumber, (z.msg) ? z.msg : "error", status);
inflateEnd(&z);
return 1;
}
int cmp_size = blockSize - z.avail_out;
if (cmp_size != (int)blockSize)
{
ERROR_LOG(LOADER, "block %d : block size error %d != %d\n", blockNumber, cmp_size, blockSize);
inflateEnd(&z);
return 1;
}
inflateEnd(&z);
}
return true;
}