diff options
author | dgp <dgp@noemail.net> | 2008-06-28 04:19:13 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2008-06-28 04:19:13 (GMT) |
commit | e090b87ca03888115fb26fe27cec6049d85efa49 (patch) | |
tree | 9f5c1563c3405a73881a188dfd01fc8bf8f65d5e /generic/tclIOUtil.c | |
parent | c37646404e1cf74697b082b63805dce506c2c7c2 (diff) | |
download | tcl-e090b87ca03888115fb26fe27cec6049d85efa49.zip tcl-e090b87ca03888115fb26fe27cec6049d85efa49.tar.gz tcl-e090b87ca03888115fb26fe27cec6049d85efa49.tar.bz2 |
* generic/tclIOUtil.c: Plug memory leak in latest commit. Thanks
Rolf Ade for detecting and Dan Steffen for the fix [Bug 2004654].
FossilOrigin-Name: 1fa14d8fac38aed6d64236f66e51b01dc6a8fa9e
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r-- | generic/tclIOUtil.c | 11 |
1 files changed, 8 insertions, 3 deletions
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. |