diff options
author | mig <mig> | 2013-12-06 00:16:07 (GMT) |
---|---|---|
committer | mig <mig> | 2013-12-06 00:16:07 (GMT) |
commit | bd06c04659422136285db5fbcb585c18d10b595d (patch) | |
tree | e3f848b42344013d3adaa8ea43adcc922d889493 | |
parent | ec2f589b56bb7241ee7f7b60aad33ccdfa46ec98 (diff) | |
download | tcl-bd06c04659422136285db5fbcb585c18d10b595d.zip tcl-bd06c04659422136285db5fbcb585c18d10b595d.tar.gz tcl-bd06c04659422136285db5fbcb585c18d10b595d.tar.bz2 |
tighter mem management in array-set compiler
-rw-r--r-- | generic/tclCompCmds.c | 4 |
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; |