summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authorvasiljevic <vasiljevic@noemail.net>2006-01-12 18:35:24 (GMT)
committervasiljevic <vasiljevic@noemail.net>2006-01-12 18:35:24 (GMT)
commit9f3224dddb2ee531439a5bc3c52d5ba320823167 (patch)
tree930fcbc4ec59554c92c173cf8b7bbace892f5f67 /generic/tclPathObj.c
parent03bf23d15da0618af73df054348633157199b402 (diff)
downloadtcl-9f3224dddb2ee531439a5bc3c52d5ba320823167.zip
tcl-9f3224dddb2ee531439a5bc3c52d5ba320823167.tar.gz
tcl-9f3224dddb2ee531439a5bc3c52d5ba320823167.tar.bz2
Fixed potential overwriting of already freed memory
which caused all kinds of (rare but reproducible) coredumps all over the place. FossilOrigin-Name: ce838456317621841a893e8bd4600a19c597d65c
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index dd354c7..9ed241a 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.48 2005/11/27 02:33:49 das Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.49 2006/01/12 18:35:28 vasiljevic Exp $
*/
#include "tclInt.h"
@@ -2015,12 +2015,16 @@ Tcl_FSGetInternalRep(
if (srcFsPathPtr->nativePathPtr == NULL) {
Tcl_FSCreateInternalRepProc *proc;
- proc = srcFsPathPtr->fsRecPtr->fsPtr->createInternalRepProc;
+ char *nativePathPtr;
+ proc = srcFsPathPtr->fsRecPtr->fsPtr->createInternalRepProc;
if (proc == NULL) {
return NULL;
}
- srcFsPathPtr->nativePathPtr = (*proc)(pathPtr);
+
+ nativePathPtr = (*proc)(pathPtr);
+ srcFsPathPtr = (FsPath*) PATHOBJ(pathPtr);
+ srcFsPathPtr->nativePathPtr = nativePathPtr;
}
return srcFsPathPtr->nativePathPtr;