diff options
author | Dennis Friis <peavey@placid.dk> | 2008-04-20 16:25:43 +0000 |
---|---|---|
committer | Dennis Friis <peavey@placid.dk> | 2008-04-20 16:25:43 +0000 |
commit | c4dc68d8a2ebf9723b1cd83c5db6196b3eb58396 (patch) | |
tree | 5f782edd3adfe56b1d200805e847e75470553f7d | |
parent | 8d95e9c4e5e919964e02391696b1371110f8fdfd (diff) | |
download | manaserv-c4dc68d8a2ebf9723b1cd83c5db6196b3eb58396.tar.gz manaserv-c4dc68d8a2ebf9723b1cd83c5db6196b3eb58396.tar.bz2 manaserv-c4dc68d8a2ebf9723b1cd83c5db6196b3eb58396.tar.xz manaserv-c4dc68d8a2ebf9723b1cd83c5db6196b3eb58396.zip |
Fix a possible memleak in inflateMemory if the stream fails to uncompress cleanly.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/utils/zlib.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,7 @@ +2008-04-20 Dennis Friis <peavey@placid.dk> + * src/utils/zlib.cpp: Fix a possible memleak in inflateMemory if the + stream fails to uncompress cleanly. + 2008-04-19 Yohann Ferreira <bertram@cegetel.net> * src/account-server/accounthandler.cpp, diff --git a/src/utils/zlib.cpp b/src/utils/zlib.cpp index a29b0c86..2bd2f237 100644 --- a/src/utils/zlib.cpp +++ b/src/utils/zlib.cpp @@ -68,6 +68,7 @@ bool inflateMemory(char *in, unsigned inLength, if (ret != Z_OK) { logZlibError(ret); + free(out); return false; } @@ -83,6 +84,7 @@ bool inflateMemory(char *in, unsigned inLength, case Z_MEM_ERROR: inflateEnd(&strm); logZlibError(ret); + free(out); return false; } @@ -94,6 +96,7 @@ bool inflateMemory(char *in, unsigned inLength, { inflateEnd(&strm); logZlibError(Z_MEM_ERROR); + free(out); return false; } @@ -107,6 +110,7 @@ bool inflateMemory(char *in, unsigned inLength, if (strm.avail_in != 0) { logZlibError(Z_DATA_ERROR); + free(out); return false; } |