From c08d157ff67d885fef923e525d7a48dc9a2094f4 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 28 Feb 2008 22:36:36 +0000 Subject: * generic/tclBasic.c (TclEvalObjvInternal): Plug memory leak when an enter trace deletes or changes the command, prompting a reparsing. Don't let the second pass lose commandPtr value allocated during the first pass. --- ChangeLog | 5 +++++ generic/tclBasic.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 994e06a..7f081e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,11 @@ 2008-02-28 Don Porter + * generic/tclBasic.c (TclEvalObjvInternal): Plug memory leak when + an enter trace deletes or changes the command, prompting a reparsing. + Don't let the second pass lose commandPtr value allocated during the + first pass. + * generic/tclCompExpr.c (ParseExpr): Plug memory leak in error message generation. diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 35c6bb9..f825fdb 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.291 2008/01/23 21:21:26 dgp Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.292 2008/02/28 22:36:37 dgp Exp $ */ #include "tclInt.h" @@ -3609,6 +3609,9 @@ TclEvalObjvInternal( if (cmdEpoch != newEpoch) { checkTraces = 0; + if (commandPtr) { + Tcl_DecrRefCount(commandPtr); + } goto reparseBecauseOfTraces; } } -- cgit v0.12