summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-03-08 15:22:38 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-03-08 15:22:38 (GMT)
commit2dad5852c21f06c8ebad40a0acdae17b7991f3b0 (patch)
tree1114a221e975d66928fed84192cc8f71a88b3dbb
parentbf203d533248ef560add28aa14207bdb91bd5a29 (diff)
downloadtcl-2dad5852c21f06c8ebad40a0acdae17b7991f3b0.zip
tcl-2dad5852c21f06c8ebad40a0acdae17b7991f3b0.tar.gz
tcl-2dad5852c21f06c8ebad40a0acdae17b7991f3b0.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 d7bdeec..4e4d715 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-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;
}