summaryrefslogtreecommitdiffstats
path: root/generic/tclIORChan.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclIORChan.c')
-rw-r--r--generic/tclIORChan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index ca3ab4b..affed02 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -571,6 +571,7 @@ TclChanCreateObjCmd(
chan = Tcl_CreateChannel(&tclRChannelType, TclGetString(rcId), rcPtr,
mode);
rcPtr->chan = chan;
+ Tcl_Preserve(chan);
chanPtr = (Channel *) chan;
/*
@@ -2145,6 +2146,7 @@ FreeReflectedChannel(
ckfree((char*) chanPtr->typePtr);
}
+ Tcl_Release(chanPtr);
n = rcPtr->argc - 2;
for (i=0; i<n; i++) {