summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-01-18 09:49:13 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-01-18 09:49:13 (GMT)
commit91c61162398c0ed35ad2306485e824c16fff667a (patch)
tree513d0778531c4bf4068fc2fac4be95538eba9acf
parent8f2192e73834a1ba84a6ea73b4970f9ad2dc102b (diff)
downloadtcl-91c61162398c0ed35ad2306485e824c16fff667a.zip
tcl-91c61162398c0ed35ad2306485e824c16fff667a.tar.gz
tcl-91c61162398c0ed35ad2306485e824c16fff667a.tar.bz2
Ensure that objects are released in all cases (hard to test this particular
one without a very large system, but the leak path existed)
-rw-r--r--generic/tclStringObj.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 0780089..5f0d547 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -33,7 +33,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStringObj.c,v 1.131 2010/01/18 09:31:01 dkf Exp $ */
+ * RCS: @(#) $Id: tclStringObj.c,v 1.132 2010/01/18 09:49:13 dkf Exp $ */
#include "tclInt.h"
#include "tommath.h"
@@ -2280,6 +2280,9 @@ Tcl_AppendFormatToObj(
Tcl_GetStringFromObj(segment, &segmentNumBytes);
if (segmentNumBytes > limit) {
+ if (allocSegment) {
+ Tcl_DecrRefCount(segment);
+ }
msg = overflow;
goto errorMsg;
}