summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-12-28 17:37:48 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-12-28 17:37:48 (GMT)
commita7b4a7560837d1f6f303dc6ee53db1a2c849aebb (patch)
tree894da08b1a2b6c54ba913c00e0392abd818f2913 /generic
parenta7e88f6d17b8ff68c0cb6f10840445088d5264f0 (diff)
downloadtcl-a7b4a7560837d1f6f303dc6ee53db1a2c849aebb.zip
tcl-a7b4a7560837d1f6f303dc6ee53db1a2c849aebb.tar.gz
tcl-a7b4a7560837d1f6f303dc6ee53db1a2c849aebb.tar.bz2
Plug memory leak.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclZlib.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index f932525..5fefab7 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclZlib.c,v 1.20 2008/12/27 10:07:06 dkf Exp $
+ * RCS: @(#) $Id: tclZlib.c,v 1.21 2008/12/28 17:37:48 dkf Exp $
*/
#include "tclInt.h"
@@ -963,6 +963,10 @@ Tcl_ZlibStreamPut(
Tcl_ListObjAppendElement(NULL, zsh->outData, obj);
}
+
+ if (dataTmp) {
+ ckfree(dataTmp);
+ }
} else {
/*
* This is easy. Just append to the inData list.
@@ -1090,6 +1094,10 @@ Tcl_ZlibStreamGet(
zsh->currentInput = 0;
}
+ /*
+ * Get the next block of data to go to inflate.
+ */
+
Tcl_ListObjIndex(zsh->interp, zsh->inData, 0, &itemObj);
itemPtr = Tcl_GetByteArrayFromObj(itemObj, &itemLen);
Tcl_IncrRefCount(itemObj);
@@ -1098,14 +1106,14 @@ Tcl_ZlibStreamGet(
zsh->stream.avail_in = itemLen;
/*
- * And remove it from the list.
+ * Remove it from the list.
*/
Tcl_ListObjReplace(NULL, zsh->inData, 0, 1, 0, NULL);
listLen--;
/*
- * And call inflate again
+ * And call inflate again.
*/
e = inflate(&zsh->stream, zsh->flush);