summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2007-04-24 22:07:53 (GMT)
committerKevin B Kenny <kennykb@acm.org>2007-04-24 22:07:53 (GMT)
commitcbcca850953622453b3b1d1d1e115027338c0e66 (patch)
tree577e7fc9d338c8c6821e9730885fa4e461344d2f
parent7b0b933b49c5110702dc91cac7a4b91e589d81a0 (diff)
downloadtcl-cbcca850953622453b3b1d1d1e115027338c0e66.zip
tcl-cbcca850953622453b3b1d1d1e115027338c0e66.tar.gz
tcl-cbcca850953622453b3b1d1d1e115027338c0e66.tar.bz2
* generic/tclListObj.c (TclLsetFlat): Fixed a bug where the new
list under construction was leaked in the error case.[Bug 1705778, leaks K13 and K14]
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclListObj.c10
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index be235dc..2137717 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,9 @@
* generic/tclBinary.c: Addressed several code paths where the error
return from the 'binary format' command leaked the result buffer.
+ * generic/tclListObj.c (TclLsetFlat): Fixed a bug where the new
+ list under construction was leaked in the error case.[Bug 1705778,
+ leaks K13 and K14]
2007-04-24 Jeff Hobbs <jeffh@ActiveState.com>
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index 5e679ff..4332492 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclListObj.c,v 1.44 2007/04/20 21:39:42 msofer Exp $
+ * RCS: @(#) $Id: tclListObj.c,v 1.45 2007/04/24 22:07:53 kennykb Exp $
*/
#include "tclInt.h"
@@ -1394,7 +1394,13 @@ TclLsetFlat(
}
if (result != TCL_OK) {
- /* Error return; message is already in interp */
+ /*
+ * Error return; message is already in interp. Clean up
+ * any excess memory.
+ */
+ if (retValuePtr != listPtr) {
+ Tcl_DecrRefCount(retValuePtr);
+ }
return NULL;
}