summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-10-27 22:34:23 (GMT)
committerhobbs <hobbs>2000-10-27 22:34:23 (GMT)
commitdc87e503bd1b4374f3035e725222ed578b5e967b (patch)
tree5625cb0afb1aaa250a9de629ef0f0161df177b63
parentbfa39016efbe32deec39db90632c5efecfa1fc50 (diff)
downloadtcl-dc87e503bd1b4374f3035e725222ed578b5e967b.zip
tcl-dc87e503bd1b4374f3035e725222ed578b5e967b.tar.gz
tcl-dc87e503bd1b4374f3035e725222ed578b5e967b.tar.bz2
* generic/tclIO.c (CloseChannel): the statePtr for a channel was
not being freed when the last channel in a stack was freed, causing a mem leak.
-rw-r--r--generic/tclIO.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 6525b28..16f77cb 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIO.c,v 1.25 2000/10/06 21:10:50 hobbs Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.26 2000/10/27 22:34:23 hobbs Exp $
*/
#include "tclInt.h"
@@ -2139,10 +2139,13 @@ CloseChannel(interp, chanPtr, errorCode)
/*
* There is only the TOP Channel, so we free the remaining
- * pointers we have and then ourselves.
+ * pointers we have and then ourselves. Since this is the
+ * last of the channels in the stack, make sure to free the
+ * ChannelState structure associated with it.
*/
chanPtr->typePtr = NULL;
+ Tcl_EventuallyFree((ClientData) statePtr, TCL_DYNAMIC);
Tcl_EventuallyFree((ClientData) chanPtr, TCL_DYNAMIC);
return errorCode;