summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-07-11 15:44:42 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-07-11 15:44:42 (GMT)
commitafe83cbf85df2fa657c86e95af1892a567643896 (patch)
tree16d545ca3bb0424b8498e634033c1f7482ed0618 /generic/tclExecute.c
parent3088c8e046d26ebc9db26c8f3edffdf32cc327be (diff)
downloadtcl-afe83cbf85df2fa657c86e95af1892a567643896.zip
tcl-afe83cbf85df2fa657c86e95af1892a567643896.tar.gz
tcl-afe83cbf85df2fa657c86e95af1892a567643896.tar.bz2
[9b352768e6] Plug memleak in INST_DICT_FIRST.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index d8c5935..2f9aac3 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -7474,6 +7474,14 @@ TEBCresume(
searchPtr = ckalloc(sizeof(Tcl_DictSearch));
if (Tcl_DictObjFirst(interp, dictPtr, searchPtr, &keyPtr,
&valuePtr, &done) != TCL_OK) {
+
+ /*
+ * dictPtr is no longer on the stack, and we're not
+ * moving it into the intrep of an iterator. We need
+ * to drop the refcount [Tcl Bug 9b352768e6].
+ */
+
+ Tcl_DecrRefCount(dictPtr);
ckfree(searchPtr);
TRACE_ERROR(interp);
goto gotError;