summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
diff options
context:
space:
mode:
authormig <mig>2013-12-06 00:16:07 (GMT)
committermig <mig>2013-12-06 00:16:07 (GMT)
commite839a385d8c656b6a1a68a21856d89711ef0a9e5 (patch)
treee3f848b42344013d3adaa8ea43adcc922d889493 /generic/tclCompCmds.c
parent74ce54a69d5333c4bb4bb621e9e245d9c153ad9e (diff)
downloadtcl-e839a385d8c656b6a1a68a21856d89711ef0a9e5.zip
tcl-e839a385d8c656b6a1a68a21856d89711ef0a9e5.tar.gz
tcl-e839a385d8c656b6a1a68a21856d89711ef0a9e5.tar.bz2
tighter mem management in array-set compiler
Diffstat (limited to 'generic/tclCompCmds.c')
-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;