• Victor Stinner's avatar
    bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276) (GH-12332) · b1405787
    Victor Stinner authored
    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 9776b063)
    b1405787
2019-03-11-15-37-33.bpo-36262.v3N6Fz.rst 189 Bytes