summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-11-10 16:46:16 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-11-10 16:46:16 (GMT)
commitda7f246c3bdbc8ce45d43a8fe08c5551f801988d (patch)
treebaf529a327bd975c75189deb91e02a757d5b777d
parent7b4578b998365822607fd302671c2109cdf27ac4 (diff)
downloadtcl-da7f246c3bdbc8ce45d43a8fe08c5551f801988d.zip
tcl-da7f246c3bdbc8ce45d43a8fe08c5551f801988d.tar.gz
tcl-da7f246c3bdbc8ce45d43a8fe08c5551f801988d.tar.bz2
* generic/tclObj.c: Plus memory leak in TclContinuationsEnter().
[Bug 2895323]
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclObj.c13
2 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 019b230..3c22fda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-10 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclObj.c: Plus memory leak in TclContinuationsEnter().
+ [Bug 2895323]
+
2009-11-09 Stuart Cassoff <stwo@users.sf.net>
* win/README: [bug 2459744]: Removed outdated Msys + Mingw info.
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 23097f6..7a37fd3 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclObj.c,v 1.139.2.5 2009/10/18 11:21:38 mistachkin Exp $
+ * RCS: @(#) $Id: tclObj.c,v 1.139.2.6 2009/11/10 16:46:16 dgp Exp $
*/
#include "tclInt.h"
@@ -574,6 +574,17 @@ TclContinuationsEnter(Tcl_Obj* objPtr,
ContLineLoc* clLocPtr =
(ContLineLoc*) ckalloc (sizeof(ContLineLoc) + num*sizeof(int));
+ if (newEntry == 0) {
+ /*
+ * Somehow we're entering ContLineLoc data for the same value more
+ * than one time. Not sure whether that's expected, or a sign of
+ * trouble, but at a minimum, we should take care not to leak the
+ * old entry.
+ */
+
+ ckfree((char *) Tcl_GetHashValue(hPtr));
+ }
+
clLocPtr->num = num;
memcpy (&clLocPtr->loc, loc, num*sizeof(int));
clLocPtr->loc[num] = CLL_END; /* Sentinel */