summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2023-03-26 15:35:10 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2023-03-26 15:35:10 (GMT)
commit1df48c6782ece4f2580769f05d64e14acaf118b0 (patch)
tree04068625012c0cf7e1a4b56965fea1c4fe20f195 /generic/tclPathObj.c
parentfc30e5e70489dbfbf19ff74d9a3bd6d29f75b4b1 (diff)
parent0fd20aeeaa230a891042e2da2b6ee43ba8058699 (diff)
downloadtcl-1df48c6782ece4f2580769f05d64e14acaf118b0.zip
tcl-1df48c6782ece4f2580769f05d64e14acaf118b0.tar.gz
tcl-1df48c6782ece4f2580769f05d64e14acaf118b0.tar.bz2
Fix for [6d4e9d1af5bf5b7d]: Memory leak: SetFsPathFromAny, assisted by the
global literal table, causes a Tcl_Obj to reference itself.
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index b14fd8a..2d73379 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -2207,6 +2207,8 @@ SetFsPathFromAny(
fsPathPtr = (FsPath *)Tcl_Alloc(sizeof(FsPath));
if (transPtr == pathPtr) {
+ Tcl_GetStringFromObj(pathPtr, NULL);
+ TclFreeInternalRep(pathPtr);
transPtr = Tcl_DuplicateObj(pathPtr);
fsPathPtr->filesystemEpoch = 0;
} else {