summaryrefslogtreecommitdiffstats
path: root/generic/tclIORChan.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-09-19 10:57:40 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-09-19 10:57:40 (GMT)
commit4e8954188850061d06183ad502d35b9b38db1f50 (patch)
tree9ac2da3836382d4f8528f121e6ed27a51d86caba /generic/tclIORChan.c
parent18492c312190b67e04959f7245dd3821b3222702 (diff)
downloadtcl-4e8954188850061d06183ad502d35b9b38db1f50.zip
tcl-4e8954188850061d06183ad502d35b9b38db1f50.tar.gz
tcl-4e8954188850061d06183ad502d35b9b38db1f50.tar.bz2
Plug a number of MarshallError memleaks.
Diffstat (limited to 'generic/tclIORChan.c')
-rw-r--r--generic/tclIORChan.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index 846618c..acf7365 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -2927,7 +2927,9 @@ ForwardProc(
int written;
if (Tcl_GetIntFromObj(interp, resObj, &written) != TCL_OK) {
- ForwardSetObjError(paramPtr, MarshallError(interp));
+ Tcl_DecrRefCount(resObj);
+ resObj = MarshallError(interp);
+ ForwardSetObjError(paramPtr, resObj);
paramPtr->output.toWrite = -1;
} else if (written==0 || paramPtr->output.toWrite<written) {
ForwardSetStaticError(paramPtr, msg_write_toomuch);
@@ -2970,7 +2972,9 @@ ForwardProc(
paramPtr->seek.offset = newLoc;
}
} else {
- ForwardSetObjError(paramPtr, MarshallError(interp));
+ Tcl_DecrRefCount(resObj);
+ resObj = MarshallError(interp);
+ ForwardSetObjError(paramPtr, resObj);
paramPtr->seek.offset = -1;
}
}
@@ -3061,7 +3065,9 @@ ForwardProc(
if (Tcl_ListObjGetElements(interp, resObj, &listc,
&listv) != TCL_OK) {
- ForwardSetObjError(paramPtr, MarshallError(interp));
+ Tcl_DecrRefCount(resObj);
+ resObj = MarshallError(interp);
+ ForwardSetObjError(paramPtr, resObj);
} else if ((listc % 2) == 1) {
/*
* Odd number of elements is wrong. [x].