summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-06-28 04:19:13 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-06-28 04:19:13 (GMT)
commit0c008d2ecb5decdf18c0e0b56d59b960d158f6b9 (patch)
tree9f5c1563c3405a73881a188dfd01fc8bf8f65d5e
parent3cc800cc721ae0225b5c3f75e72d2b5bea69a6d8 (diff)
downloadtcl-0c008d2ecb5decdf18c0e0b56d59b960d158f6b9.zip
tcl-0c008d2ecb5decdf18c0e0b56d59b960d158f6b9.tar.gz
tcl-0c008d2ecb5decdf18c0e0b56d59b960d158f6b9.tar.bz2
* generic/tclIOUtil.c: Plug memory leak in latest commit. Thanks
Rolf Ade for detecting and Dan Steffen for the fix [Bug 2004654].
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclIOUtil.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a2e266..bc040fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-28 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclIOUtil.c: Plug memory leak in latest commit. Thanks
+ Rolf Ade for detecting and Dan Steffen for the fix [Bug 2004654].
+
2008-06-23 Don Porter <dgp@users.sourceforge.net>
* generic/tclIOUtil.c: Fixed bug in Tcl_GetTranslatedPath() when
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 0f2f373..0de5890 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.37 2008/06/23 15:45:39 dgp Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.38 2008/06/28 04:19:15 dgp Exp $
*/
#include "tclInt.h"
@@ -5440,10 +5440,15 @@ Tcl_FSGetTranslatedPath(interp, pathPtr)
* translated version of cwdPtr to normPathPtr, we'll get the
* translated result we need, and can store it for future use.
*/
- retObj = Tcl_FSJoinToPath(Tcl_FSGetTranslatedPath(interp,
- srcFsPathPtr->cwdPtr), 1, &(srcFsPathPtr->normPathPtr));
+
+ Tcl_Obj *translatedCwdPtr = Tcl_FSGetTranslatedPath(interp,
+ srcFsPathPtr->cwdPtr);
+
+ retObj = Tcl_FSJoinToPath(translatedCwdPtr, 1,
+ &(srcFsPathPtr->normPathPtr));
srcFsPathPtr->translatedPathPtr = retObj;
Tcl_IncrRefCount(retObj);
+ Tcl_DecrRefCount(translatedCwdPtr);
} else {
/*
* It is a pure absolute, normalized path object.