summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2023-03-26 15:02:55 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2023-03-26 15:02:55 (GMT)
commit2002e0f0f0b3cb11791ef5c3c7d651af68d82d84 (patch)
tree03cf20c43856ac7c161b042f19ee2d837195b676 /generic/tclPathObj.c
parent2122f0eb09d729bfbfbdbbf1540fa26bbfa42453 (diff)
downloadtcl-2002e0f0f0b3cb11791ef5c3c7d651af68d82d84.zip
tcl-2002e0f0f0b3cb11791ef5c3c7d651af68d82d84.tar.gz
tcl-2002e0f0f0b3cb11791ef5c3c7d651af68d82d84.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 87aed3a..aefc84f 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -2350,6 +2350,8 @@ SetFsPathFromAny(
fsPathPtr = (FsPath *)ckalloc(sizeof(FsPath));
if (transPtr == pathPtr) {
+ Tcl_GetStringFromObj(pathPtr, NULL);
+ TclFreeInternalRep(pathPtr);
transPtr = Tcl_DuplicateObj(pathPtr);
fsPathPtr->filesystemEpoch = 0;
} else {