summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-12-13 22:11:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-12-13 22:11:34 (GMT)
commit10bb91f83c06110b9f30488d2aa5a264e7ec8294 (patch)
treed65bc5c06e6a13e5fdeebe85de7d2004521380e6 /generic/tclEncoding.c
parent7a8cb9d50b6409dfbfbf8e60bd57f4f77ffec457 (diff)
downloadtcl-10bb91f83c06110b9f30488d2aa5a264e7ec8294.zip
tcl-10bb91f83c06110b9f30488d2aa5a264e7ec8294.tar.gz
tcl-10bb91f83c06110b9f30488d2aa5a264e7ec8294.tar.bz2
* generic/tclEncoding.c: Plugged some memory leaks. Thanks to
* generic/tclUtil.c: Rolf Ade for reports and testing [Bug 1083082]
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index a525283..11cf425 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclEncoding.c,v 1.31 2004/12/04 21:19:18 dgp Exp $
+ * RCS: @(#) $Id: tclEncoding.c,v 1.32 2004/12/13 22:11:35 dgp Exp $
*/
#include "tclInt.h"
@@ -1360,6 +1360,7 @@ scan:
Tcl_AppendToObj(nameObj, ".enc", -1);
path = Tcl_FSJoinToPath(directory, 1, &nameObj);
Tcl_DecrRefCount(directory);
+ Tcl_DecrRefCount(nameObj);
Tcl_IncrRefCount(path);
chan = Tcl_FSOpenFileChannel(NULL, path, "r", 0);
Tcl_DecrRefCount(path);
@@ -3084,7 +3085,7 @@ InitializeEncodingSearchPath(valuePtr, lengthPtr, encodingPtr)
if ((0 == Tcl_FSStat(path, &stat)) && S_ISDIR(stat.st_mode)) {
Tcl_ListObjAppendElement(NULL, searchPath, path);
}
- Tcl_IncrRefCount(path);
+ Tcl_DecrRefCount(path);
}
Tcl_DecrRefCount(libPath);
Tcl_DecrRefCount(encodingObj);