summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2010-11-18 00:44:39 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2010-11-18 00:44:39 (GMT)
commit4e232e3df1b018c1bf239180c52fec83d279362d (patch)
tree8ed48669bdf57a8b7d4a32779395027d41bbce71 /generic/tclNamesp.c
parent3f2525724acdd550fd3b577eefd493a61d49e3b8 (diff)
downloadtcl-4e232e3df1b018c1bf239180c52fec83d279362d.zip
tcl-4e232e3df1b018c1bf239180c52fec83d279362d.tar.gz
tcl-4e232e3df1b018c1bf239180c52fec83d279362d.tar.bz2
* generic/tclNamesp.c: fix leak due to bad looping construct,
[Bug 3111059] (Correct fix this time around)
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index e6bed55..baed244 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -22,7 +22,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.215 2010/11/18 00:35:18 msofer Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.216 2010/11/18 00:44:39 msofer Exp $
*/
#include "tclInt.h"
@@ -881,12 +881,14 @@ Tcl_DeleteNamespace(
*/
for (entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
- entryPtr != NULL;
- entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search)) {
+ entryPtr != NULL;) {
cmdPtr = (Command *) Tcl_GetHashValue(entryPtr);
if (cmdPtr->nreProc == NRInterpCoroutine) {
Tcl_DeleteCommandFromToken((Tcl_Interp *) iPtr,
(Tcl_Command) cmdPtr);
+ entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
+ } else {
+ entryPtr = Tcl_NextHashEntry(&search);
}
}