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 4b61538..2f2c95c 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -586,6 +586,7 @@ TclChanCreateObjCmd(
chan = Tcl_CreateChannel(&tclRChannelType, TclGetString(rcId), rcPtr,
mode);
rcPtr->chan = chan;
+ Tcl_Preserve(chan);
chanPtr = (Channel *) chan;
/*
@@ -2306,6 +2307,7 @@ FreeReflectedChannel(
ckfree(chanPtr->typePtr);
chanPtr->typePtr = NULL;
}
+ Tcl_Release(chanPtr);
FreeReflectedChannelArgs(rcPtr);