summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-11-20 15:47:30 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-11-20 15:47:30 (GMT)
commitc32d032cbd7947d9e64e931df87fc4f374d81e7f (patch)
tree7e02359071b911f8968e3f97fa77946c51e03d45 /generic/tclUtil.c
parent5498d8aaa43327e94fd652a66fde74f4187452db (diff)
downloadtcl-c32d032cbd7947d9e64e931df87fc4f374d81e7f.zip
tcl-c32d032cbd7947d9e64e931df87fc4f374d81e7f.tar.gz
tcl-c32d032cbd7947d9e64e931df87fc4f374d81e7f.tar.bz2
[40f628e8e3] Tcl_ListObjReplace() callers need to handle TCL_ERROR.
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 69d0b17..bc1490e 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -1791,7 +1791,12 @@ Tcl_ConcatObj(
TclListObjGetElements(NULL, objPtr, &listc, &listv);
if (listc) {
if (resPtr) {
- Tcl_ListObjReplace(NULL, resPtr, INT_MAX, 0, listc, listv);
+ if (TCL_OK != Tcl_ListObjReplace(NULL, resPtr,
+ INT_MAX, 0, listc, listv)) {
+ /* Abandon ship! */
+ Tcl_DecrRefCount(resPtr);
+ goto slow;
+ }
} else {
resPtr = TclListObjCopy(NULL, objPtr);
}
@@ -1808,6 +1813,7 @@ Tcl_ConcatObj(
* the slow way, using the string representations.
*/
+ slow:
/* First try to pre-allocate the size required */
for (i = 0; i < objc; i++) {
element = TclGetStringFromObj(objv[i], &elemLength);