diff options
author | dgp <dgp@users.sourceforge.net> | 2014-07-11 04:49:49 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-07-11 04:49:49 (GMT) |
commit | fe3773a12fba16561208c2fcfddaccf977bc8073 (patch) | |
tree | 692fb68770013f8c7f0939b458d0013db7e514a3 | |
parent | e5eec4e2673a958ea73df11616a148c06adb3db4 (diff) | |
download | tcl-fe3773a12fba16561208c2fcfddaccf977bc8073.zip tcl-fe3773a12fba16561208c2fcfddaccf977bc8073.tar.gz tcl-fe3773a12fba16561208c2fcfddaccf977bc8073.tar.bz2 |
[3479689] Plug memory leak due to incomplete bug fix.
-rw-r--r-- | generic/tclPathObj.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index fe6063f..99d576d 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -2437,19 +2437,13 @@ SetFsPathFromAny( } TclDecrRefCount(parts); } else { - /* - * Simple case. "rest" is relative path. Just join it. The - * "rest" object will be freed when Tcl_FSJoinToPath returns - * (unless something else claims a refCount on it). - */ - - Tcl_Obj *joined; - Tcl_Obj *rest = Tcl_NewStringObj(name+split+1, -1); + Tcl_Obj *pair[2]; - Tcl_IncrRefCount(transPtr); - joined = Tcl_FSJoinToPath(transPtr, 1, &rest); - TclDecrRefCount(transPtr); - transPtr = joined; + pair[0] = transPtr; + pair[1] = Tcl_NewStringObj(name+split+1, -1); + transPtr = TclJoinPath(2, pair); + Tcl_DecrRefCount(pair[0]); + Tcl_DecrRefCount(pair[1]); } } } else { |