summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormig <mig>2013-12-06 00:16:07 (GMT)
committermig <mig>2013-12-06 00:16:07 (GMT)
commitbd06c04659422136285db5fbcb585c18d10b595d (patch)
treee3f848b42344013d3adaa8ea43adcc922d889493
parentec2f589b56bb7241ee7f7b60aad33ccdfa46ec98 (diff)
downloadtcl-bd06c04659422136285db5fbcb585c18d10b595d.zip
tcl-bd06c04659422136285db5fbcb585c18d10b595d.tar.gz
tcl-bd06c04659422136285db5fbcb585c18d10b595d.tar.bz2
tighter mem management in array-set compiler
-rw-r--r--generic/tclCompCmds.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index da14af1..73b1ec3 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -323,11 +323,11 @@ TclCompileArraySetCmd(
keyVar = AnonymousLocal(envPtr);
valVar = AnonymousLocal(envPtr);
- infoPtr = ckalloc(sizeof(ForeachInfo) + sizeof(ForeachVarList *));
+ infoPtr = ckalloc(sizeof(ForeachInfo));
infoPtr->numLists = 1;
infoPtr->firstValueTemp = dataVar;
infoPtr->loopCtTemp = iterVar;
- infoPtr->varLists[0] = ckalloc(sizeof(ForeachVarList) * 2*sizeof(int));
+ infoPtr->varLists[0] = ckalloc(sizeof(ForeachVarList) + sizeof(int));
infoPtr->varLists[0]->numVars = 2;
infoPtr->varLists[0]->varIndexes[0] = keyVar;
infoPtr->varLists[0]->varIndexes[1] = valVar;