aboutsummaryrefslogtreecommitdiff
path: root/src/SCompression.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <ladislav.zezula@avg.com>2015-05-28 13:49:23 +0200
committerLadislav Zezula <ladislav.zezula@avg.com>2015-05-28 13:49:23 +0200
commit1b38ceb0d4bb4ae32cb93c295e3ef493b91f9a78 (patch)
tree5634e1d3fd17386975db1c0d4e95176db098bc1f /src/SCompression.cpp
parentc26e12c79f2a5e0c092de4a62565bdae4bf5a7dd (diff)
+ Fixed defects found by Coverity (well, most of them)
Diffstat (limited to 'src/SCompression.cpp')
-rw-r--r--src/SCompression.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/SCompression.cpp b/src/SCompression.cpp
index 5402771..d706a6f 100644
--- a/src/SCompression.cpp
+++ b/src/SCompression.cpp
@@ -296,7 +296,10 @@ static int Decompress_PKLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInB
// If PKLIB is unable to decompress the data, return 0;
if(Info.pbOutBuff == pvOutBuffer)
+ {
+ STORM_FREE(work_buf);
return 0;
+ }
// Give away the number of decompressed bytes
*pcbOutBuffer = (int)(Info.pbOutBuff - (unsigned char *)pvOutBuffer);
@@ -324,6 +327,7 @@ static void Compress_BZIP2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBu
// Initialize the BZIP2 compression
strm.bzalloc = NULL;
strm.bzfree = NULL;
+ strm.opaque = NULL;
// Blizzard uses 9 as blockSize100k, (0x30 as workFactor)
// Last checked on Starcraft II
@@ -358,6 +362,9 @@ static int Decompress_BZIP2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInB
// Initialize the BZIP2 decompression
strm.bzalloc = NULL;
strm.bzfree = NULL;
+ strm.opaque = NULL;
+
+ // Initialize decompression
if(BZ2_bzDecompressInit(&strm, 0, 0) == BZ_OK)
{
strm.next_in = (char *)pvInBuffer;