From ad8915efaf90d9299a50f1e2eabb53be2ea2fc70 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 23 Sep 2010 17:59:38 +0000 Subject: * generic/tclCmdAH.c: Fix cases where value returned by * generic/tclEvent.c: Tcl_GetReturnOptions() was leaked. * generic/tclMain.c: Thanks to Jeff Hobbs for discovery of the anti-pattern to seek and destroy. --- ChangeLog | 7 +++++++ generic/tclCmdAH.c | 3 ++- generic/tclEvent.c | 3 ++- generic/tclMain.c | 3 ++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6562f48..3a6cc4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-09-23 Don Porter + + * generic/tclCmdAH.c: Fix cases where value returned by + * generic/tclEvent.c: Tcl_GetReturnOptions() was leaked. + * generic/tclMain.c: Thanks to Jeff Hobbs for discovery of the + anti-pattern to seek and destroy. + 2010-09-19 Donal K. Fellows * doc/file.n (file readlink): [Bug 3070580]: Typofix. diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 5b7cd34..4ec8dda 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.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: tclCmdAH.c,v 1.93.2.2 2009/12/28 13:53:40 dkf Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.93.2.3 2010/09/23 17:59:38 dgp Exp $ */ #include "tclInt.h" @@ -275,6 +275,7 @@ Tcl_CatchObjCmd( Tcl_Obj *options = Tcl_GetReturnOptions(interp, result); if (NULL == Tcl_ObjSetVar2(interp, optionVarNamePtr, NULL, options, 0)) { + Tcl_DecrRefCount(options); Tcl_ResetResult(interp); Tcl_AppendResult(interp, "couldn't save return options in variable", NULL); diff --git a/generic/tclEvent.c b/generic/tclEvent.c index a10da8f..b1dbf9e 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEvent.c,v 1.80.2.2 2009/10/07 23:10:50 andreas_kupries Exp $ + * RCS: @(#) $Id: tclEvent.c,v 1.80.2.3 2010/09/23 17:59:39 dgp Exp $ */ #include "tclInt.h" @@ -277,6 +277,7 @@ HandleBgErrors( } Tcl_WriteChars(errChannel, "\n", 1); Tcl_Flush(errChannel); + Tcl_DecrRefCount(options); } } } diff --git a/generic/tclMain.c b/generic/tclMain.c index 11e6ccb..99fa603 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.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: tclMain.c,v 1.44 2007/12/13 15:23:19 dgp Exp $ + * RCS: @(#) $Id: tclMain.c,v 1.44.2.1 2010/09/23 17:59:39 dgp Exp $ */ #include "tclInt.h" @@ -454,6 +454,7 @@ Tcl_Main( Tcl_WriteObj(errChannel, valuePtr); } Tcl_WriteChars(errChannel, "\n", 1); + Tcl_DecrRefCount(options); } exitCode = 1; } -- cgit v0.12