]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276) (GH-12332)
authorVictor Stinner <vstinner@redhat.com>
Thu, 14 Mar 2019 16:19:52 +0000 (17:19 +0100)
committerGitHub <noreply@github.com>
Thu, 14 Mar 2019 16:19:52 +0000 (17:19 +0100)
commitb14057877fd897eaee7bc6626682fc6092b6bbd2
treeb0e75922f1a071ecb92b44ec8257b051e1c7f54a
parent2dd6e079ae71f3723fbea2582ac080be06a6968f
bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276) (GH-12332)

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