summaryrefslogtreecommitdiffstats
path: root/generic/tclListObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r--generic/tclListObj.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index b623272..f1daf19 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -908,7 +908,7 @@ Tcl_ListObjReplace(
listRepPtr = AttemptNewList(NULL, newMax, NULL);
if (listRepPtr == NULL) {
unsigned int limit = LIST_MAX - numRequired;
- unsigned int extra = numRequired - listRepPtr->elemCount
+ unsigned int extra = numRequired - numElems
+ TCL_GROWTH_MIN_ALLOC/sizeof(Tcl_Obj *);
int growth = (int) ((extra > limit) ? limit : extra);