summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-06-28 04:22:59 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-06-28 04:22:59 (GMT)
commitdccac44164436d0d0cb0ca2765837a813ccd4d0c (patch)
tree19c78e0e07659c775ed9da96db2b3f22e6eafd58 /generic/tclPathObj.c
parentd66d8e00acf2a70834e5505a54c02ff54408534e (diff)
downloadtcl-dccac44164436d0d0cb0ca2765837a813ccd4d0c.zip
tcl-dccac44164436d0d0cb0ca2765837a813ccd4d0c.tar.gz
tcl-dccac44164436d0d0cb0ca2765837a813ccd4d0c.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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index c41aafc..b52e0b0 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.70 2008/06/24 20:02:31 dgp Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.71 2008/06/28 04:23:00 dgp Exp $
*/
#include "tclInt.h"
@@ -1602,10 +1602,14 @@ 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