]> granicus.if.org Git - python/commit
bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276)
authorVictor Stinner <vstinner@redhat.com>
Wed, 13 Mar 2019 16:55:01 +0000 (17:55 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Mar 2019 16:55:01 +0000 (17:55 +0100)
commit9776b0636ae39668d3ce1c006d4be01dad01bf9f
tree4e51efb7dfc17dee9f91909d60c4bb66e915b3ff
parent86900a49000c4a96ad1dc34e49d8af4245b08843
bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276)

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.
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