summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-12-07 15:08:46 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-12-07 15:08:46 (GMT)
commitf02342c0abbf0a641833353f729836274db3b80a (patch)
tree71a2fc12e21428f67108259ced4ec165a370fd99 /generic/tclCmdMZ.c
parent0a1a1db5620ec53dd755544a21572bf4391b43ac (diff)
downloadtcl-f02342c0abbf0a641833353f729836274db3b80a.zip
tcl-f02342c0abbf0a641833353f729836274db3b80a.tar.gz
tcl-f02342c0abbf0a641833353f729836274db3b80a.tar.bz2
Plug memory leak. [Bug 2910044]
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 427bf68..28f4d77 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.196 2009/11/18 21:59:50 nijtmans Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.197 2009/12/07 15:08:47 dkf Exp $
*/
#include "tclInt.h"
@@ -4433,8 +4433,10 @@ TryPostBody(
Tcl_ListObjIndex(NULL, info[3], 0, &varName);
if (Tcl_ObjSetVar2(interp, varName, NULL, resultObj,
TCL_LEAVE_ERR_MSG) == NULL) {
+ Tcl_DecrRefCount(resultObj);
goto handlerFailed;
}
+ Tcl_DecrRefCount(resultObj);
if (dummy > 1) {
Tcl_ListObjIndex(NULL, info[3], 1, &varName);
if (Tcl_ObjSetVar2(interp, varName, NULL, options,
@@ -4442,6 +4444,12 @@ TryPostBody(
goto handlerFailed;
}
}
+ } else {
+ /*
+ * Dispose of the result to prevent a memleak. [Bug 2910044]
+ */
+
+ Tcl_DecrRefCount(resultObj);
}
/*