bpo-34080: Fix memory leak on parsing error by vstinner · Pull Request #8242 · python/cpython
* bpo-34080, bpo-34084: err_free() now always releases 'text' memory allocated by PyObject_Malloc() to fix a memory leak on parsing error. Previously, err->text was not released (by err_input()) on E_ERROR error. * Remove also "with Barry as BDFL, use '<>' instead of '!='" static string error message (previously set to err_ret->text) because in practice, err_ret->text is always set later. Add also an assertion to make sure that err_ret->text is only set once. * Replace old PyObject_MALLOC() and PyObject_FREE() aliases with PyObject_Malloc() and PyObject_Free() function calls. Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> Co-Authored-By: Xiang Zhang <angwerzx@126.com>
vstinner
changed the title
bpo-34080: Fix memory leak in err_clear()
bpo-34080: Fix memory leak on parsing error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters