summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-10-21 20:30:43 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-10-21 20:30:43 (GMT)
commit7cc7684dbe5d31849989b7cab1c5d43ea0be1105 (patch)
treeb17c5929251c2c6784afdd04854f85994b7cf09c
parentd557adb5a1825fccdee62bab579da1201604d11c (diff)
downloadtcl-7cc7684dbe5d31849989b7cab1c5d43ea0be1105.zip
tcl-7cc7684dbe5d31849989b7cab1c5d43ea0be1105.tar.gz
tcl-7cc7684dbe5d31849989b7cab1c5d43ea0be1105.tar.bz2
Bug 1334461
-rw-r--r--ChangeLog6
-rwxr-xr-xgeneric/tclStrToD.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c1d211c..12dd08a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-21 Kevin B. Kenny <kennykb@acm.org>
+
+ * generic/tclStrToD.c (RefineApproximation): Plugged a memory leak
+ where two intermediate results were not freed on one return path.
+ [Bug 1334461]. Thanks to Eric Melbardis for the patch.
+
2005-10-21 Donal K. Fellows <dkf@users.sf.net>
* doc/binary.n: Clarify that virtually all code that uses the 'h'
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 7c2d6a8..398d33d 100755
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStrToD.c,v 1.12 2005/10/13 15:23:22 dkf Exp $
+ * RCS: @(#) $Id: tclStrToD.c,v 1.13 2005/10/21 20:30:43 kennykb Exp $
*
*----------------------------------------------------------------------
*/
@@ -1616,6 +1616,8 @@ RefineApproximation(
*/
if (mp_cmp_mag(&twoMd, &twoMv) == MP_LT) {
+ mp_clear(&twoMd); //EPM
+ mp_clear(&twoMv); //EPM
return approxResult;
}
@@ -2080,7 +2082,7 @@ TclInitDoubleConversion(void)
maxpow10_wide = (int)
floor(sizeof(Tcl_WideUInt) * CHAR_BIT * log(2.) / log(10.));
pow10_wide = (Tcl_WideUInt *)
- Tcl_Alloc((maxpow10_wide + 1) * sizeof(Tcl_WideUInt));
+ ckalloc((maxpow10_wide + 1) * sizeof(Tcl_WideUInt)); //EPM NETKIT
u = 1;
for (i = 0; i < maxpow10_wide; ++i) {
pow10_wide[i] = u;