From 2ea113369bcc08204d1f481fad9d22c1cdc2b58d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 8 Feb 2013 10:41:01 -0800 Subject: [PATCH] Fix memory leak in CSO reading. --- Core/FileSystems/BlockDevices.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Core/FileSystems/BlockDevices.cpp b/Core/FileSystems/BlockDevices.cpp index c413209c0c..7d270260f5 100644 --- a/Core/FileSystems/BlockDevices.cpp +++ b/Core/FileSystems/BlockDevices.cpp @@ -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; }