summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2007-04-24 02:42:18 (GMT)
committerKevin B Kenny <kennykb@acm.org>2007-04-24 02:42:18 (GMT)
commit146814b0108455aaaafda4e59a014c6e895d5cd1 (patch)
tree3dabb44a145009e9a5d1c9fb4f2cd52dcff62ce5
parentf5d116abda422caa1ca7f043400c43522b1fada7 (diff)
downloadtcl-146814b0108455aaaafda4e59a014c6e895d5cd1.zip
tcl-146814b0108455aaaafda4e59a014c6e895d5cd1.tar.gz
tcl-146814b0108455aaaafda4e59a014c6e895d5cd1.tar.bz2
* generic/tclIOCmd.c (Tcl_ReadObjCmd): Plugged a leak of the
buffer object if the physocal read returned an error and the bypass area had no message. * generic/tclIORChan.c (TclChanCreateObjCmd): Plugged a leak of the return value from the "initialize" method of a channel handler.
-rw-r--r--ChangeLog9
-rw-r--r--generic/tclIOCmd.c4
-rw-r--r--generic/tclIORChan.c5
3 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 5bc1858..069dbe6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-04-24 Kevin B. Kenny <kennykb@acm.org>
+
+ * generic/tclIOCmd.c (Tcl_ReadObjCmd): Plugged a leak of the
+ buffer object if the physocal read returned an error and the
+ bypass area had no message.
+ * generic/tclIORChan.c (TclChanCreateObjCmd): Plugged a leak of
+ the return value from the "initialize" method of a channel
+ handler.
+
2007-04-23 Daniel Steffen <das@users.sourceforge.net>
*** 8.5a6 TAGGED FOR RELEASE ***
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index 542aeb6..97d11ff 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOCmd.c,v 1.39 2007/04/02 18:48:03 dgp Exp $
+ * RCS: @(#) $Id: tclIOCmd.c,v 1.40 2007/04/24 02:42:18 kennykb Exp $
*/
#include "tclInt.h"
@@ -411,8 +411,8 @@ Tcl_ReadObjCmd(
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "error reading \"", name, "\": ",
Tcl_PosixError(interp), NULL);
- Tcl_DecrRefCount(resultPtr);
}
+ Tcl_DecrRefCount(resultPtr);
return TCL_ERROR;
}
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index 66a0f50..6ddcce8 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.23 2007/04/23 23:07:23 kennykb Exp $
+ * RCS: @(#) $Id: tclIORChan.c,v 1.24 2007/04/24 02:42:18 kennykb Exp $
*/
#include <tclInt.h>
@@ -556,6 +556,7 @@ TclChanCreateObjCmd(
Tcl_AppendToObj(err, " initialize\" returned non-list: ", -1);
Tcl_AppendObjToObj(err, resObj);
Tcl_SetObjResult(interp, err);
+ Tcl_DecrRefCount(resObj);
goto error;
}
@@ -568,12 +569,14 @@ TclChanCreateObjCmd(
Tcl_AppendToObj(err, " initialize\" returned ", -1);
Tcl_AppendObjToObj(err, Tcl_GetObjResult(interp));
Tcl_SetObjResult(interp, err);
+ Tcl_DecrRefCount(resObj);
goto error;
}
methods |= FLAG(methIndex);
listc--;
}
+ Tcl_DecrRefCount(resObj);
if ((REQUIRED_METHODS & methods) != REQUIRED_METHODS) {
TclNewLiteralStringObj(err, "chan handler \"");