From 729a99a663c180693e5deb7888f823e034b857e6 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 24 Apr 2007 15:36:38 +0000 Subject: * generic/tclCompExpr.c (ParseExpr): Memory leak in error case; the literal Tcl_Obj was not getting freed. [Bug 1705778, leak #1 (new)] --- ChangeLog | 5 +++++ generic/tclCompExpr.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 15f3a1d..b3e985b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-04-24 Don Porter + + * generic/tclCompExpr.c (ParseExpr): Memory leak in error case; the + literal Tcl_Obj was not getting freed. [Bug 1705778, leak #1 (new)] + 2007-04-24 Kevin B. Kenny * generic/tclExecute.c (TclExecuteByteCode): Plugged six memory diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 6acf13e..b373969 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompExpr.c,v 1.51 2007/04/23 19:04:43 kennykb Exp $ + * RCS: @(#) $Id: tclCompExpr.c,v 1.52 2007/04/24 15:36:42 dgp Exp $ */ #include "tclInt.h" @@ -310,6 +310,7 @@ ParseExpr( if (Tcl_GetBooleanFromObj(NULL, literal, &b) == TCL_OK) { lexeme = BOOLEAN; } else { + Tcl_DecrRefCount(literal); msg = Tcl_ObjPrintf( "invalid bareword \"%.*s%s\"", (scanned < limit) ? scanned : limit - 3, start, -- cgit v0.12