← 返回首页
gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing by colorfulappl · Pull Request #99890 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing#99890

Merged
kumaraditya303 merged 9 commits into
python:mainfrom
colorfulappl:clear_freed_pointer
Dec 17, 2022
Merged

gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing#99890
kumaraditya303 merged 9 commits into
python:mainfrom
colorfulappl:clear_freed_pointer

Conversation

colorfulappl commented Nov 30, 2022
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

In the family of _PyArg_Parse functions, pointers can be passed in as arguments to store the parsed PyArgs.
If a pointer is assigned to newly allocated memory and the memory is freed as a result of an error while parsing the subsequent PyArgs, the pointer should be set to NULL; otherwise, it leaks the freed memory.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Footer

© 2026 GitHub, Inc.