summaryrefslogtreecommitdiffstats
path: root/generic/tclIOGT.c
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-05-19 23:07:13 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-05-19 23:07:13 (GMT)
commit1b8701ee3d55320b42676e77ce32c04950facee6 (patch)
tree53582f83932c90609c0ae3a75d3668f48369187f /generic/tclIOGT.c
parent16a75f3cbf8ba7ab30d4f5f1adcd658269d9ae8c (diff)
parent83d22bd1f6fd20b5ce07fc4e16af80619f859422 (diff)
downloadtcl-1b8701ee3d55320b42676e77ce32c04950facee6.zip
tcl-1b8701ee3d55320b42676e77ce32c04950facee6.tar.gz
tcl-1b8701ee3d55320b42676e77ce32c04950facee6.tar.bz2
Merge trunk
Diffstat (limited to 'generic/tclIOGT.c')
-rw-r--r--generic/tclIOGT.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c
index 98a1dd3..3206a4f 100644
--- a/generic/tclIOGT.c
+++ b/generic/tclIOGT.c
@@ -379,7 +379,11 @@ ExecuteCallback(
unsigned char *resBuf;
Tcl_InterpState state = NULL;
int res = TCL_OK;
- Tcl_Obj *command = TclListObjCopy(NULL, dataPtr->command);
+ Tcl_Obj *command = TclDuplicatePureObj(
+ interp, dataPtr->command, &tclListType.objType);
+ if (!command) {
+ return TCL_ERROR;
+ }
Tcl_Interp *eval = dataPtr->interp;
Tcl_Preserve(eval);
@@ -397,7 +401,12 @@ ExecuteCallback(
}
Tcl_IncrRefCount(command);
- Tcl_ListObjAppendElement(NULL, command, Tcl_NewStringObj((char *) op, -1));
+ res = Tcl_ListObjAppendElement(NULL, command, Tcl_NewStringObj((char *) op, -1));
+ if (res != TCL_OK) {
+ Tcl_DecrRefCount(command);
+ Tcl_Release(eval);
+ return res;
+ }
/*
* Use a byte-array to prevent the misinterpretation of binary data coming