summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclPathObj.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e45bb02..b512045 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-29 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclPathObj.c: Plug memory leak in [Bug 1999176] fix. Thanks
+ Rolf Ade for detecting.
+
2008-06-28 Don Porter <dgp@users.sourceforge.net>
* generic/tclPathObj.c: Plug memory leak in [Bug 1972879] fix. Thanks
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 070bb2e..cdf6e2b 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclPathObj.c,v 1.66.2.3 2008/06/28 04:22:06 dgp Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.66.2.4 2008/06/29 19:08:36 dgp Exp $
*/
#include "tclInt.h"
@@ -1879,6 +1879,7 @@ Tcl_FSGetNormalizedPath(
if (fsPathPtr->normPathPtr == NULL) {
ClientData clientData = NULL;
Tcl_Obj *useThisCwd = NULL;
+ int pureNormalized = 1;
/*
* Since normPathPtr is NULL, but this is a valid path object, we know
@@ -1927,6 +1928,7 @@ Tcl_FSGetNormalizedPath(
return NULL;
}
+ pureNormalized = 0;
Tcl_DecrRefCount(absolutePath);
absolutePath = Tcl_FSJoinToPath(useThisCwd, 1, &absolutePath);
Tcl_IncrRefCount(absolutePath);
@@ -1946,6 +1948,7 @@ Tcl_FSGetNormalizedPath(
if (absolutePath == NULL) {
return NULL;
}
+ pureNormalized = 0;
#endif /* __WIN32__ */
}
}
@@ -1967,7 +1970,7 @@ Tcl_FSGetNormalizedPath(
* is an absolute path).
*/
- if (useThisCwd == NULL) {
+ if (pureNormalized) {
if (!strcmp(TclGetString(fsPathPtr->normPathPtr),
TclGetString(pathPtr))) {
/*
@@ -1983,7 +1986,8 @@ Tcl_FSGetNormalizedPath(
fsPathPtr->normPathPtr = pathPtr;
}
- } else {
+ }
+ if (useThisCwd != NULL) {
/*
* We just need to free an object we allocated above for relative
* paths (this was returned by Tcl_FSJoinToPath above), and then