summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-03-08 15:14:18 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-03-08 15:14:18 (GMT)
commit896ceaf5023cd32e741ee7f6895eaeedf6afef49 (patch)
tree87bbcd9961f419cb80469d1a59d7d0795318b56e
parent7b1f9159604d4005f984eb3f32a4be126e5a4834 (diff)
downloadtcl-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--ChangeLog5
-rw-r--r--generic/tclResult.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f54c6a..0086f85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;
}