summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormig <mig>2013-12-06 00:02:16 (GMT)
committermig <mig>2013-12-06 00:02:16 (GMT)
commitda3e64744b0cee3f710bbb90c2092e61372fbd25 (patch)
tree5251d98bedc040c00f0707c92325d542372a8db5
parent0bdb90fcb80df7e904c08fc7f16fdf6f69cbac15 (diff)
downloadtcl-da3e64744b0cee3f710bbb90c2092e61372fbd25.zip
tcl-da3e64744b0cee3f710bbb90c2092e61372fbd25.tar.gz
tcl-da3e64744b0cee3f710bbb90c2092e61372fbd25.tar.bz2
tighter mem management
-rw-r--r--generic/tclCompCmds.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 78c6c5a..da14af1 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -2602,16 +2602,14 @@ CompileEachloopCmd(
*/
infoPtr = ckalloc(sizeof(ForeachInfo)
- + numLists * sizeof(ForeachVarList *));
+ + (numLists - 1) * sizeof(ForeachVarList *));
infoPtr->numLists = numLists;
- infoPtr->firstValueTemp = collect;
- infoPtr->loopCtTemp = 0;
for (loopIndex = 0; loopIndex < numLists; loopIndex++) {
ForeachVarList *varListPtr;
numVars = varcList[loopIndex];
varListPtr = ckalloc(sizeof(ForeachVarList)
- + numVars * sizeof(int));
+ + (numVars - 1) * sizeof(int));
varListPtr->numVars = numVars;
for (j = 0; j < numVars; j++) {
const char *varName = varvList[loopIndex][j];