diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2010-01-18 09:49:13 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2010-01-18 09:49:13 (GMT) |
commit | 91c61162398c0ed35ad2306485e824c16fff667a (patch) | |
tree | 513d0778531c4bf4068fc2fac4be95538eba9acf /generic/tclStringObj.c | |
parent | 8f2192e73834a1ba84a6ea73b4970f9ad2dc102b (diff) | |
download | tcl-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)
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r-- | generic/tclStringObj.c | 5 |
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; } |