diff options
author | dgp <dgp@users.sourceforge.net> | 2014-04-21 20:02:39 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-04-21 20:02:39 (GMT) |
commit | 80299d811c1d9072b7aa16812efa92261169cc98 (patch) | |
tree | 3fb1e729f90fb050de4bcc1fb0829f7ba5b6475a /generic/tclIOCmd.c | |
parent | eff70f42a20d07ad259305cd44a5aaaa8e544ce0 (diff) | |
parent | 5407657340a624d763a1c122624a5b5da218f911 (diff) | |
download | tcl-80299d811c1d9072b7aa16812efa92261169cc98.zip tcl-80299d811c1d9072b7aa16812efa92261169cc98.tar.gz tcl-80299d811c1d9072b7aa16812efa92261169cc98.tar.bz2 |
merge trunk
Diffstat (limited to 'generic/tclIOCmd.c')
-rw-r--r-- | generic/tclIOCmd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 1673bce..d5ac64d 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -453,6 +453,7 @@ Tcl_ReadObjCmd( resultPtr = Tcl_NewObj(); Tcl_IncrRefCount(resultPtr); + Tcl_Preserve(chan); charactersRead = Tcl_ReadChars(chan, resultPtr, toRead, 0); if (charactersRead < 0) { /* @@ -467,6 +468,7 @@ Tcl_ReadObjCmd( "error reading \"%s\": %s", TclGetString(chanObjPtr), Tcl_PosixError(interp))); } + Tcl_Release(chan); Tcl_DecrRefCount(resultPtr); return TCL_ERROR; } @@ -485,6 +487,7 @@ Tcl_ReadObjCmd( } } Tcl_SetObjResult(interp, resultPtr); + Tcl_Release(chan); Tcl_DecrRefCount(resultPtr); return TCL_OK; } |