diff options
author | dgp <dgp@users.sourceforge.net> | 2011-03-08 15:14:18 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-03-08 15:14:18 (GMT) |
commit | 896ceaf5023cd32e741ee7f6895eaeedf6afef49 (patch) | |
tree | 87bbcd9961f419cb80469d1a59d7d0795318b56e | |
parent | 7b1f9159604d4005f984eb3f32a4be126e5a4834 (diff) | |
download | tcl-896ceaf5023cd32e741ee7f6895eaeedf6afef49.zip tcl-896ceaf5023cd32e741ee7f6895eaeedf6afef49.tar.gz tcl-896ceaf5023cd32e741ee7f6895eaeedf6afef49.tar.bz2 |
* generic/tclResult.c (ResetObjResult): Correct failure to clear
invalid intrep. Thanks to Colin McDonald. [Bug 3202905]
-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-07 Jan Nijtmans <nijtmans@users.sf.net> * unix/tclUnixInit: diff --git a/generic/tclResult.c b/generic/tclResult.c index 556903c..7b58d44 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -959,12 +959,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; } |