-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-101046: Fix a potential memory leak in the parser when raising MemoryError #101051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -801,7 +801,7 @@ def handle_alt_loop(self, node: Alt, is_gather: bool, rulename: Optional[str]) - | |||
self.print( | |||
"void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));" | |||
) | |||
self.out_of_memory_return(f"!_new_children") | |||
self.out_of_memory_return(f"!new_children", cleanup_code="PyMem_Free(_children);") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.out_of_memory_return(f"!new_children", cleanup_code="PyMem_Free(_children);") | |
self.out_of_memory_return(f"!_new_children", cleanup_code="PyMem_Free(_children);") |
…n raising MemoryError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10, 3.11. |
Sorry, @pablogsal, I could not cleanly backport this to |
Sorry @pablogsal, I had trouble checking out the |
Sorry, @pablogsal, I could not cleanly backport this to |
…n raising MemoryError (pythonGH-101051). (cherry picked from commit 1de4395) Co-authored-by: Pablo Galindo Salgado <[email protected]>
GH-101085 is a backport of this pull request to the 3.11 branch. |
…n raising MemoryError (pythonGH-101051). (cherry picked from commit 1de4395) Co-authored-by: Pablo Galindo Salgado <[email protected]>
GH-101086 is a backport of this pull request to the 3.10 branch. |
…ing MemoryError (GH-101051). (#101086) Co-authored-by: Pablo Galindo Salgado <[email protected]>
…ing MemoryError (GH-101051) (#101085) Co-authored-by: Pablo Galindo Salgado <[email protected]>
@pablogsal Does this still need backporting to 3.9? Otherwise let's remove the backport label. |
Removed |
Uh oh!
There was an error while loading. Please reload this page.