summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-06-28 13:56:20 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-06-28 13:56:20 (GMT)
commite1bb8afe489c46336d1fbc4a223e26a9b3979121 (patch)
tree507edde926efb54c14512dc64d4c9c2c544250c6 /generic/tclVar.c
parentf0da4e55104381d0a8bf98a2c3dfc4848efc1b3d (diff)
downloadtcl-e1bb8afe489c46336d1fbc4a223e26a9b3979121.zip
tcl-e1bb8afe489c46336d1fbc4a223e26a9b3979121.tar.gz
tcl-e1bb8afe489c46336d1fbc4a223e26a9b3979121.tar.bz2
* generic/tclVar.c (UnsetVarStruct): fix possible segfault with
recent streamlining.
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index d6049e9..b0036d5 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclVar.c,v 1.143 2007/06/26 13:34:36 msofer Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.144 2007/06/28 13:56:21 msofer Exp $
*/
#include "tclInt.h"
@@ -2140,6 +2140,7 @@ UnsetVarStruct(
}
if (part1Ptr) {
Tcl_DecrRefCount(part1Ptr);
+ part1 = NULL;
}
}
@@ -2171,10 +2172,10 @@ UnsetVarStruct(
} else if (TclIsVarArray(dummyVarPtr) && !TclIsVarUndefined(dummyVarPtr)) {
/*
* If the variable is an array, delete all of its elements. This must
- * be done after calling the traces on the array, above (that's the
- * way traces are defined). If the array is traced, its name is
- * already in part1. If not, and the name is required for some
- * element, it will be computed at DeleteArray.
+ * be done after calling and deleting the traces on the array, above
+ * (that's the way traces are defined). If the array name is not
+ * present and is required for a trace on some element, it will be
+ * computed at DeleteArray.
*/
DeleteArray(iPtr, part1, dummyVarPtr, (flags