From f5d116abda422caa1ca7f043400c43522b1fada7 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Mon, 23 Apr 2007 23:07:22 +0000 Subject: Plugged two memory leaks --- ChangeLog | 2 ++ generic/tclIORChan.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b655f00..5bc1858 100644 --- a/ChangeLog +++ b/ChangeLog @@ -57,6 +57,8 @@ when parsing expressions that contain syntax errors. * generic/tclEnv.c (ReplaceString): Clear memory correctly when growing the cache to avoid reads of uninitialised data. + * generic/tclIORChan.c (TclChanCreateObjCmd, + FreeReflectedChannel): Plugged two memory leaks. * generic/tclStrToD.c (AccumulateDecimalDigit): Fixed a mistake where we'd run beyond the end of the 'pow10_wide' array if a number begins with a string of more than 'maxpow10_wide' zeroes. diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 5ad1dbc..66a0f50 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.22 2007/04/10 22:02:59 dkf Exp $ + * RCS: @(#) $Id: tclIORChan.c,v 1.23 2007/04/23 23:07:23 kennykb Exp $ */ #include @@ -1029,8 +1029,8 @@ ReflectClose( Tcl_DecrRefCount(resObj); /* Remove reference we held from the * invoke */ -#ifdef TCL_THREADS FreeReflectedChannel(rcPtr); +#ifdef TCL_THREADS } #endif return (result == TCL_OK) ? EOK : EINVAL; @@ -1942,7 +1942,7 @@ FreeReflectedChannel( * [SF Bug 1667990] See [x] in NewReflectedChannel for lock * n+1 = argc-1. */ - Tcl_IncrRefCount(rcPtr->argv[n+1]); + Tcl_DecrRefCount(rcPtr->argv[n+1]); ckfree((char*) rcPtr->argv); ckfree((char*) rcPtr); -- cgit v0.12