summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2008-07-03 17:38:32 (GMT)
committerandreas_kupries <akupries@shaw.ca>2008-07-03 17:38:32 (GMT)
commit941f69e59411a1e30db7f56ce9994bbd56f479e1 (patch)
tree297a3c60ebf8ca6a43c9032642e37fec889f5696
parentcd7cb1f61d5ef41720805bb2fdb479a6e05e1ea4 (diff)
downloadtcl-941f69e59411a1e30db7f56ce9994bbd56f479e1.zip
tcl-941f69e59411a1e30db7f56ce9994bbd56f479e1.tar.gz
tcl-941f69e59411a1e30db7f56ce9994bbd56f479e1.tar.bz2
* generic/tclIORChan.c (InvokeTclMethod): Fixed the memory leak
reported in [Bug 1987821]. Thanks to Miguel for the rpeort and Don Porter for tracking the cause down.
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclIORChan.c14
2 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 585305b..0420a29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-07-03 Andreas Kupries <andreask@activestate.com>
+
+ * generic/tclIORChan.c (InvokeTclMethod): Fixed the memory leak
+ reported in [Bug 1987821]. Thanks to Miguel for the rpeort and
+ Don Porter for tracking the cause down.
+
2008-07-03 Don Porter <dgp@users.sourceforge.net>
* library/package.tcl: Removed [file readable] testing from
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index ac19b45..a30469b 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.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: tclIORChan.c,v 1.33 2008/04/27 22:21:30 dkf Exp $
+ * RCS: @(#) $Id: tclIORChan.c,v 1.34 2008/07/03 17:38:38 andreas_kupries Exp $
*/
#include <tclInt.h>
@@ -2129,6 +2129,18 @@ InvokeTclMethod(
*resultObjPtr = resObj;
Tcl_IncrRefCount(resObj);
}
+
+ /*
+ * Cleanup of the dynamic parts of the command.
+ */
+
+ if (argOneObj) {
+ Tcl_DecrRefCount(argOneObj);
+ if (argTwoObj) {
+ Tcl_DecrRefCount(argTwoObj);
+ }
+ }
+
return TCL_ERROR;
}