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 cb0282a..a09a7a6 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);