summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authormig <mig>2013-12-06 00:02:16 (GMT)
committermig <mig>2013-12-06 00:02:16 (GMT)
commitec2f589b56bb7241ee7f7b60aad33ccdfa46ec98 (patch)
tree5251d98bedc040c00f0707c92325d542372a8db5 /generic
parentff9c2d4ad9a37c50a4921bada422365ae85d5ac1 (diff)
downloadtcl-ec2f589b56bb7241ee7f7b60aad33ccdfa46ec98.zip
tcl-ec2f589b56bb7241ee7f7b60aad33ccdfa46ec98.tar.gz
tcl-ec2f589b56bb7241ee7f7b60aad33ccdfa46ec98.tar.bz2
tighter mem management
Diffstat (limited to 'generic')
-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];