Title: bpo-34080: Fix memory leak on parsing error by vstinner · Pull Request #8242 · python/cpython · GitHub
Open Graph Title: bpo-34080: Fix memory leak on parsing error by vstinner · Pull Request #8242 · python/cpython
X Title: bpo-34080: Fix memory leak on parsing error by vstinner · Pull Request #8242 · python/cpython
Description: 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 https://bugs.python.org/issue34080
Open Graph Description: 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_i...
X Description: 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 releas...
Opengraph URL: https://github.com/python/cpython/pull/8242
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0686dfef-2967-0758-7923-0d1a6874cadc |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9FDE:30CB25:12F44E:1988DF:6A5512CA |
| html-safe-nonce | 2e0f5d5673ff3eb13798712dcbec361444aef63d7ce6520eb8a5b5ef05d7d4c3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RkRFOjMwQ0IyNToxMkY0NEU6MTk4OERGOjZBNTUxMkNBIiwidmlzaXRvcl9pZCI6IjUzMzc3MTI1ODMzMjY4OTY4NDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0e239b71ffc0e82fcb02eceb3e2303ce3e7335f9cefd895827dfd41e8e50c7e9 |
| hovercard-subject-tag | pull_request:200637525 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/8242/files |
| twitter:image | https://avatars.githubusercontent.com/u/194129?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/194129?s=400&v=4 |
| og:image:alt | 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_i... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 682d273eacb2ac51680c6eb9c0b270f029f7ce74c32090f319083c34497e28a5 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0f2adbaa4b43ea302b02981f637a782ae92ed6dc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width