From 7cc7684dbe5d31849989b7cab1c5d43ea0be1105 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Fri, 21 Oct 2005 20:30:43 +0000 Subject: Bug 1334461 --- ChangeLog | 6 ++++++ generic/tclStrToD.c | 6 ++++-- 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 + + * 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 * 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; -- cgit v0.12