diff options
author | Kevin B Kenny <kennykb@acm.org> | 2007-04-23 23:07:22 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2007-04-23 23:07:22 (GMT) |
commit | f5d116abda422caa1ca7f043400c43522b1fada7 (patch) | |
tree | 00240e202f8d2b2d168b214a5a045e3bcf9fdb34 | |
parent | 2936b8a762b81a1d5dd142383daf8c905dd19263 (diff) | |
download | tcl-f5d116abda422caa1ca7f043400c43522b1fada7.zip tcl-f5d116abda422caa1ca7f043400c43522b1fada7.tar.gz tcl-f5d116abda422caa1ca7f043400c43522b1fada7.tar.bz2 |
Plugged two memory leaks
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | generic/tclIORChan.c | 6 |
2 files changed, 5 insertions, 3 deletions
@@ -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 <tclInt.h> @@ -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); |