summaryrefslogtreecommitdiffstats
path: root/generic/tclZlib.c
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2015-06-11 02:47:41 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2015-06-11 02:47:41 (GMT)
commite99979bfcfa11a59f05746da9d5e2961ef21c5c8 (patch)
treebaf656b15cdfdb49a9507246eb8d3d4e8a18fc19 /generic/tclZlib.c
parent4c5f334c063b8a3d203e16bb2fc18e62e79dd598 (diff)
downloadtcl-e99979bfcfa11a59f05746da9d5e2961ef21c5c8.zip
tcl-e99979bfcfa11a59f05746da9d5e2961ef21c5c8.tar.gz
tcl-e99979bfcfa11a59f05746da9d5e2961ef21c5c8.tar.bz2
Plug memory leaks in the Tcl_ZlibInflate() error handling code. Fix for ticket [478c446889].
Diffstat (limited to 'generic/tclZlib.c')
-rw-r--r--generic/tclZlib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 956e3f9..c5ccc72 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -1757,6 +1757,7 @@ Tcl_ZlibInflate(
if (headerPtr) {
e = inflateGetHeader(&stream, headerPtr);
if (e != Z_OK) {
+ inflateEnd(&stream);
goto error;
}
}
@@ -1780,7 +1781,7 @@ Tcl_ZlibInflate(
if ((stream.avail_in == 0) && (stream.avail_out > 0)) {
e = Z_STREAM_ERROR;
- goto error;
+ break;
}
newBufferSize = bufferSize + 5 * stream.avail_in;
if (newBufferSize == bufferSize) {