From 64185c47504eede671b677c06c5019cd35bf6949 Mon Sep 17 00:00:00 2001 From: Kevin Meaney Date: Mon, 4 Jan 2016 11:22:31 +0000 Subject: [PATCH] Removing a potential leek found by static analysis. --- MiniZip/unzip.c | 3 +++ MiniZip/zip.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/MiniZip/unzip.c b/MiniZip/unzip.c index df4e534..690a3f9 100755 --- a/MiniZip/unzip.c +++ b/MiniZip/unzip.c @@ -342,7 +342,10 @@ local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f return 0; if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + { + TRYFREE(buf); return 0; + } file_size = ZTELL64(*pzlib_filefunc_def, filestream); diff --git a/MiniZip/zip.c b/MiniZip/zip.c index 0ffb133..aec2f37 100755 --- a/MiniZip/zip.c +++ b/MiniZip/zip.c @@ -575,7 +575,10 @@ local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f return 0; if (ZSEEK64(*pzlib_filefunc_def, filestream, 0, ZLIB_FILEFUNC_SEEK_END) != 0) + { + TRYFREE(buf); return 0; + } file_size = ZTELL64(*pzlib_filefunc_def, filestream);