summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-06-28 04:22:04 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-06-28 04:22:04 (GMT)
commit7e889ea1e3186f0fa678da5b27a2156d324fbcfa (patch)
tree38b9520286ce9429004532c211389e6b22c03876 /generic/tclPathObj.c
parent30ce01a710bebc9edf262ad88a1a26509bedd921 (diff)
downloadtcl-7e889ea1e3186f0fa678da5b27a2156d324fbcfa.zip
tcl-7e889ea1e3186f0fa678da5b27a2156d324fbcfa.tar.gz
tcl-7e889ea1e3186f0fa678da5b27a2156d324fbcfa.tar.bz2
* generic/tclPathObj.c: Plug memory leak in [Bug 1972879] fix. Thanks
Rolf Ade for detecting and Dan Steffen for the fix [Bug 2004654].
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index e3006bf..070bb2e 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclPathObj.c,v 1.66.2.2 2008/06/24 20:05:58 dgp Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.66.2.3 2008/06/28 04:22:06 dgp Exp $
*/
#include "tclInt.h"
@@ -1602,10 +1602,15 @@ Tcl_FSGetTranslatedPath(
* 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. This is