diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclResult.c | 12 |
2 files changed, 12 insertions, 5 deletions
@@ -1,3 +1,8 @@ +2011-03-08 Don Porter <dgp@users.sourceforge.net> + + * generic/tclResult.c (ResetObjResult): Correct failure to clear + invalid intrep. Thanks to Colin McDonald. [Bug 3202905] + 2011-03-08 Donal K. Fellows <dkf@users.sf.net> * generic/tclAssembly.c, tests/assemble.test: Migrate to use a style diff --git a/generic/tclResult.c b/generic/tclResult.c index f60ae26..2a04f18 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -980,12 +980,14 @@ ResetObjResult( TclNewObj(objResultPtr); Tcl_IncrRefCount(objResultPtr); iPtr->objResultPtr = objResultPtr; - } else if (objResultPtr->bytes != tclEmptyStringRep) { - if (objResultPtr->bytes != NULL) { - ckfree((char *) objResultPtr->bytes); + } else { + if (objResultPtr->bytes != tclEmptyStringRep) { + if (objResultPtr->bytes) { + ckfree((char *) objResultPtr->bytes); + } + objResultPtr->bytes = tclEmptyStringRep; + objResultPtr->length = 0; } - objResultPtr->bytes = tclEmptyStringRep; - objResultPtr->length = 0; TclFreeIntRep(objResultPtr); objResultPtr->typePtr = NULL; } |