From 0eeeeffffb57a74d4c7c20806ffa179517190e41 Mon Sep 17 00:00:00 2001 From: andreas_kupries Date: Thu, 3 Jul 2008 17:38:18 +0000 Subject: * generic/tclIORChan.c (InvokeTclMethod): Fixed the memory leak reported in [Bug 1987821]. Thanks to Miguel for the rpeort and Don Porter for tracking the cause down. --- ChangeLog | 6 ++++++ generic/tclIORChan.c | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e8670ba..466dcb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-03 Andreas Kupries + + * generic/tclIORChan.c (InvokeTclMethod): Fixed the memory leak + reported in [Bug 1987821]. Thanks to Miguel for the rpeort and + Don Porter for tracking the cause down. + 2008-07-03 Don Porter * library/package.tcl: Removed [file readable] testing from diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 51c5e61..d13b9aac 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIORChan.c,v 1.28.2.4 2008/05/03 21:06:02 das Exp $ + * RCS: @(#) $Id: tclIORChan.c,v 1.28.2.5 2008/07/03 17:38:18 andreas_kupries Exp $ */ #include @@ -2126,6 +2126,18 @@ InvokeTclMethod( *resultObjPtr = resObj; Tcl_IncrRefCount(resObj); } + + /* + * Cleanup of the dynamic parts of the command. + */ + + if (argOneObj) { + Tcl_DecrRefCount(argOneObj); + if (argTwoObj) { + Tcl_DecrRefCount(argTwoObj); + } + } + return TCL_ERROR; } -- cgit v0.12