summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2006-11-04 00:09:33 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2006-11-04 00:09:33 (GMT)
commitf0fce3b27df91a506d77ccc5bfec17437a6f079e (patch)
treec4cd241ddf7134b92ba6b59f0f9d58ced641fa38 /generic/tclBasic.c
parent582529b442db759535075226bac5cb74b4b5c783 (diff)
downloadtcl-f0fce3b27df91a506d77ccc5bfec17437a6f079e.zip
tcl-f0fce3b27df91a506d77ccc5bfec17437a6f079e.tar.gz
tcl-f0fce3b27df91a506d77ccc5bfec17437a6f079e.tar.bz2
* generic/tclBasic.c (TEOVI): fix por possible leak of a Command
in the presence of execution traces that delete it.
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 0f5c535..40cc7fb 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.215 2006/11/03 23:24:43 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.216 2006/11/04 00:09:33 msofer Exp $
*/
#include "tclInt.h"
@@ -3418,6 +3418,7 @@ TclEvalObjvInternal(
if (checkTraces && (command != NULL)) {
int cmdEpoch = cmdPtr->cmdEpoch;
+ int newEpoch;
/*
* Execute any command or execution traces. Note that we bump up the
@@ -3434,7 +3435,8 @@ TclEvalObjvInternal(
traceCode = TclCheckExecutionTraces(interp, command, length,
cmdPtr, code, TCL_TRACE_ENTER_EXEC, objc, objv);
}
- cmdPtr->refCount--;
+ newEpoch = cmdPtr->cmdEpoch;
+ TclCleanupCommand(cmdPtr);
/*
* If the traces modified/deleted the command or any existing traces,
@@ -3444,7 +3446,7 @@ TclEvalObjvInternal(
* implementation.
*/
- if (cmdEpoch != cmdPtr->cmdEpoch) {
+ if (cmdEpoch != newEpoch) {
checkTraces = 0;
goto reparseBecauseOfTraces;
}