]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276) (GH-12331) 12337/head
authorVictor Stinner <vstinner@redhat.com>
Thu, 14 Mar 2019 16:12:01 +0000 (17:12 +0100)
committerGitHub <noreply@github.com>
Thu, 14 Mar 2019 16:12:01 +0000 (17:12 +0100)
commit9818360ed94b39c4605951077b73ae798cddbfb9
treef31ae6b2b18ed91133d78ee35623fc0d20164368
parent783bed4c8daf65a2893d94761ea44af4e3718f4f
bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276) (GH-12331)

Fix an unlikely memory leak on conversion from string to float in the
function _Py_dg_strtod() used by float(str), complex(str),
pickle.load(), marshal.load(), etc.

Fix an unlikely memory leak in _Py_dg_strtod() on "undfl:" label:
rewrite memory management in this function to always release all
memory before exiting the function. Initialize variables to NULL, and
set them to NULL after calling Bfree() at the "cont:" label.

Note: Bfree(NULL) is well defined: it does nothing.

(cherry picked from commit 9776b0636ae39668d3ce1c006d4be01dad01bf9f)
Misc/NEWS.d/next/Core and Builtins/2019-03-11-15-37-33.bpo-36262.v3N6Fz.rst [new file with mode: 0644]
Python/dtoa.c