From 2002e0f0f0b3cb11791ef5c3c7d651af68d82d84 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Sun, 26 Mar 2023 15:02:55 +0000 Subject: Fix for [6d4e9d1af5bf5b7d]: Memory leak: SetFsPathFromAny, assisted by the global literal table, causes a Tcl_Obj to reference itself. --- generic/tclPathObj.c | 2 ++ 1 file changed, 2 insertions(+) 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 { -- cgit v0.12