summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-02-28 15:59:30 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-02-28 15:59:30 (GMT)
commitc859f1ed43975d6d5d402bb1efa8e2a3fb991388 (patch)
treecd74b13fd346d5c804e71774b1a04a7479cf0bb3 /generic
parent60ee451054fa072c36796fce1c41b63781fee85d (diff)
downloadtcl-c859f1ed43975d6d5d402bb1efa8e2a3fb991388.zip
tcl-c859f1ed43975d6d5d402bb1efa8e2a3fb991388.tar.gz
tcl-c859f1ed43975d6d5d402bb1efa8e2a3fb991388.tar.bz2
* generic/tclCompCmds.c (TclCompileReturnCmd): The 2007-10-18 commit
to optimize compiled [return -level 0 $x] [RFE 1794073] introduced a memory leak of the return options dictionary. Fixing that.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompCmds.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 82edcd7..da97f08 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompCmds.c,v 1.141 2008/02/12 10:27:26 dkf Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.142 2008/02/28 15:59:34 dgp Exp $
*/
#include "tclInt.h"
@@ -3358,6 +3358,7 @@ TclCompileReturnCmd(
/* Optimize [return -level 0 $x]. */
Tcl_DictObjSize(NULL, returnOpts, &size);
if (size == 0 && level == 0 && code == TCL_OK) {
+ Tcl_DecrRefCount(returnOpts);
return TCL_OK;
}