summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2005-04-09 21:12:35 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2005-04-09 21:12:35 (GMT)
commite2c08535f035fb77e79ea66ff3f19ae5b183a6dc (patch)
tree87f4b0b0e0e91143230afe0c7f018e3f69828961
parentb6189ef8afea8ebff29c75f2d774c20fee4f793e (diff)
downloadtcl-e2c08535f035fb77e79ea66ff3f19ae5b183a6dc.zip
tcl-e2c08535f035fb77e79ea66ff3f19ae5b183a6dc.tar.gz
tcl-e2c08535f035fb77e79ea66ff3f19ae5b183a6dc.tar.bz2
* generic/tclExecute.c: fix possible leak of expansion Tcl_Objs
-rw-r--r--ChangeLog4
-rw-r--r--generic/tclExecute.c15
2 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 5077b3e..2c5a525 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-04-09 Miguel Sofer <msofer@users.sf.net>
+
+ * generic/tclExecute.c: fix possible leak of expansion Tcl_Objs
+
2005-04-09 Daniel Steffen <das@users.sourceforge.net>
* macosx/README: updated requirements for OS & developer tool
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 7f90890..726c024 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.179 2005/04/05 16:56:26 dgp Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.180 2005/04/09 21:12:36 msofer Exp $
*/
#include "tclInt.h"
@@ -5061,10 +5061,19 @@ TclExecuteByteCode(interp, codePtr)
abnormalReturn:
{
+ /*
+ * Clear all expansions.
+ */
+
+ while (expandNestList) {
+ Tcl_Obj *objPtr = expandNestList->internalRep.twoPtrValue.ptr2;
+ TclDecrRefCount(expandNestList);
+ expandNestList = objPtr;
+ }
Tcl_Obj **initTosPtr = eePtr->stackPtr + initStackTop;
while (tosPtr > initTosPtr) {
- valuePtr = POP_OBJECT();
- TclDecrRefCount(valuePtr);
+ Tcl_Obj *objPtr = POP_OBJECT();
+ TclDecrRefCount(objPtr);
}
if (tosPtr < initTosPtr) {
fprintf(stderr, "\nTclExecuteByteCode: abnormal return at pc %u: stack top %d < entry stack top %d\n",