diff options
author | kbk <kbk@noemail.net> | 2011-08-06 03:19:00 (GMT) |
---|---|---|
committer | kbk <kbk@noemail.net> | 2011-08-06 03:19:00 (GMT) |
commit | cdb19e1cf16b2a40fee845446ff7c94c86b2c5a1 (patch) | |
tree | 049ebf51b6868056c16d3d76ea3b2ac73c7d2ed2 /generic/tclStrToD.c | |
parent | df3413fbe67d7a2c1a714d8c3bd0409ba248cd2c (diff) | |
parent | 764744c3639a123805d83811a41e7cde8a7a9cdf (diff) | |
download | tcl-cdb19e1cf16b2a40fee845446ff7c94c86b2c5a1.zip tcl-cdb19e1cf16b2a40fee845446ff7c94c86b2c5a1.tar.gz tcl-cdb19e1cf16b2a40fee845446ff7c94c86b2c5a1.tar.bz2 |
Plugged a memory leak in double->string
conversion. [Bug 3386975]
FossilOrigin-Name: c9b7bd387ffd3ed84f5c84f63ac88b38b3b69a99
Diffstat (limited to 'generic/tclStrToD.c')
-rwxr-xr-x | generic/tclStrToD.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 8a961ff..c2d4ed8 100755 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -3875,6 +3875,7 @@ StrictBignumConversion( * S = 2**s2 * 5*s5 */ + mp_init_multi(&temp, &dig, NULL); TclBNInitBignumFromWideUInt(&b, bw); mp_mul_2d(&b, b2, &b); mp_init_set_int(&S, 1); @@ -3889,13 +3890,11 @@ StrictBignumConversion( ilim =ilim1; --k; } - mp_init(&temp); /* * Convert the leading digit. */ - mp_init(&dig); i = 0; mp_div(&b, &S, &dig, &b); if (dig.used > 1 || dig.dp[0] >= 10) { @@ -3983,7 +3982,7 @@ StrictBignumConversion( * string. */ - mp_clear_multi(&b, &temp, NULL); + mp_clear_multi(&b, &S, &temp, &dig, NULL); *s = '\0'; *decpt = k; if (endPtr) { |