From 8691a6254e1afce0248c4ff5807236e23e1167a0 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 23 Sep 2010 18:08:35 +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 b3b6247..5601843 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-23 Jan Nijtmans * unix/tclAppInit.c: Make compilable with -DUNICODE (not diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 7ef3bec..eac0cea 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.126 2010/08/30 14:02:09 msofer Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.127 2010/09/23 18:08:35 dgp Exp $ */ #include "tclInt.h" @@ -336,6 +336,7 @@ CatchObjCmdCallback( 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 ad87cd5..ba2bb64 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.93 2010/06/16 14:49:50 nijtmans Exp $ + * RCS: @(#) $Id: tclEvent.c,v 1.94 2010/09/23 18:08:35 dgp Exp $ */ #include "tclInt.h" @@ -281,6 +281,7 @@ HandleBgErrors( } Tcl_WriteChars(errChannel, "\n", 1); Tcl_Flush(errChannel); + Tcl_DecrRefCount(options); } } } diff --git a/generic/tclMain.c b/generic/tclMain.c index 5d4c6f9..b274f41 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.50 2010/04/30 07:07:06 nijtmans Exp $ + * RCS: @(#) $Id: tclMain.c,v 1.51 2010/09/23 18:08:35 dgp Exp $ */ #include "tclInt.h" @@ -368,6 +368,7 @@ Tcl_Main( Tcl_WriteObj(errChannel, valuePtr); } Tcl_WriteChars(errChannel, "\n", 1); + Tcl_DecrRefCount(options); } exitCode = 1; } -- cgit v0.12