diff options
Diffstat (limited to 'generic/tclIOGT.c')
| -rw-r--r-- | generic/tclIOGT.c | 13 |
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 |
