8000 Merged revisions 77578 via svnmerge from · python/cpython@c4f1868 · GitHub
[go: up one dir, main page]

Skip to content

Commit c4f1868

Browse files
committed
Merged revisions 77578 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77578 | mark.dickinson | 2010-01-17 13:37:57 +0000 (Sun, 17 Jan 2010) | 2 lines Issue #7632: Fix a memory leak in _Py_dg_strtod. ........
1 parent fc8d6f4 commit c4f1868

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Misc/NEWS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ Core and Builtins
3333
alpha 2, including: (1) a serious 'wrong output' bug that could
3434
occur for long (> 40 digit) input strings, (2) a crash in dtoa.c
3535
that occurred in debug builds when parsing certain long numeric
36-
strings corresponding to subnormal values, and (3) a number of flaws
37-
that could lead to incorrectly rounded results.
36+
strings corresponding to subnormal values, (3) a memory leak for
37+
some values large enough to cause overflow, and (4) a number of
38+
flaws that could lead to incorrectly rounded results.
3839

3940
- The __complex__ method is now looked up on the class of instances to make it
4041
consistent with other special methods.

Python/dtoa.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1939,8 +1939,14 @@ _Py_dg_strtod(const char *s00, char **se)
19391939
dval(&rv) += adj.d;
19401940
if ((word0(&rv) & Exp_mask) >=
19411941
Exp_msk1*(DBL_MAX_EXP+Bias-P)) {
1942-
if (word0(&rv0) == Big0 && word1(&rv0) == Big1)
1942+
if (word0(&rv0) == Big0 && word1(&rv0) == Big1) {
1943+
Bfree(bb);
1944+
Bfree(bd);
1945+
Bfree(bs);
1946+
Bfree(bd0);
1947+
Bfree(delta);
19431948
goto ovfl;
1949+
}
19441950
word0(&rv) = Big0;
19451951
word1(&rv) = Big1;
19461952
goto cont;

0 commit comments

Comments
 (0)
0