From 91c61162398c0ed35ad2306485e824c16fff667a Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 18 Jan 2010 09:49:13 +0000 Subject: Ensure that objects are released in all cases (hard to test this particular one without a very large system, but the leak path existed) --- generic/tclStringObj.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit v0.12