Title: Possible memory leaks when realloc fails · Issue #149931 · python/cpython · GitHub
Open Graph Title: Possible memory leaks when realloc fails · Issue #149931 · python/cpython
X Title: Possible memory leaks when realloc fails · Issue #149931 · python/cpython
Description: Bug report Bug description: Some PyMem_Realloc() / PyMem_RawRealloc() calls overwrite the original pointer directly. If realloc fails, the old pointer is still valid, but it can be lost and leaked. See the comming PR for detail. This is ...
Open Graph Description: Bug report Bug description: Some PyMem_Realloc() / PyMem_RawRealloc() calls overwrite the original pointer directly. If realloc fails, the old pointer is still valid, but it can be lost and leaked....
X Description: Bug report Bug description: Some PyMem_Realloc() / PyMem_RawRealloc() calls overwrite the original pointer directly. If realloc fails, the old pointer is still valid, but it can be lost and leaked....
Opengraph URL: https://github.com/python/cpython/issues/149931
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Possible memory leaks when realloc fails","articleBody":"# Bug report\n\n### Bug description:\n\nSome `PyMem_Realloc()` / `PyMem_RawRealloc()` calls overwrite the original pointer directly.\n\nIf realloc fails, the old pointer is still valid, but it can be lost and leaked. See the comming PR for detail.\n\nThis is found using Claude Code.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-149932\n* gh-150439\n* gh-150476\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/aisk","@type":"Person","name":"aisk"},"datePublished":"2026-05-17T05:56:24Z","url":"https://github.com/python/cpython/issues/149931"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3bc10793-0fc0-9a18-aef3-c4b52fe616b3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D00A:2270F4:3A2F837:4D1C20C:6B021B7B |
| html-safe-nonce | fa7167775679f080b8dd77b7bac2d6428ee04f59b3ee54b10c57d96f96d4b358 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDBBOjIyNzBGNDozQTJGODM3OjREMUMyMEM6NkIwMjFCN0IiLCJ2aXNpdG9yX2lkIjoiNTE5NTA3NjgzODY3NDk5Mzg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5d8aaf8825be96850f06d3929b7fa66ddef744856c4f431fdb96f184a6cb66f7 |
| hovercard-subject-tag | issue:4462457327 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/149931/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0d87c1c3a28e3a8c39bd50a64117c83eae9a3ca91da5371631c919e1391b8912/python/cpython/issues/149931 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0d87c1c3a28e3a8c39bd50a64117c83eae9a3ca91da5371631c919e1391b8912/python/cpython/issues/149931 |
| og:image:alt | Bug report Bug description: Some PyMem_Realloc() / PyMem_RawRealloc() calls overwrite the original pointer directly. If realloc fails, the old pointer is still valid, but it can be lost and leaked.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aisk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width