diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclZlib.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 3ddc3fb..80431a3 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -2253,7 +2253,16 @@ ZlibTransformClose( ZlibChannelData *cd = instanceData; int e, result = TCL_OK; + /* + * Delete the support timer. + */ + ZlibTransformTimerKill(cd); + + /* + * Flush any data waiting to be compressed. + */ + if (cd->mode == TCL_ZLIB_STREAM_DEFLATE) { cd->outStream.avail_in = 0; do { @@ -2291,6 +2300,10 @@ ZlibTransformClose( e = inflateEnd(&cd->outStream); } + /* + * Release all memory. + */ + if (cd->inBuffer) { ckfree(cd->inBuffer); cd->inBuffer = NULL; @@ -2299,6 +2312,7 @@ ZlibTransformClose( ckfree(cd->outBuffer); cd->outBuffer = NULL; } + ckfree(cd); return result; } |