Skip to content

fix: Fix potential memory leak pypy #3774

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

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

Skylion007
Copy link
Collaborator

@Skylion007 Skylion007 commented Mar 2, 2022

Description

  • This would potentially leak if the early return occurred for PyPy based on where d[self].is_none(). We should call PY_DECREF before this line since the value of result is not used in the if clause. We do not have any valgrind testing on PyPy builds so our testing suite likely missed this bug.

Suggested changelog entry:

* Fixed a potential memleak in PyPy in ``get_type_override``.

@Skylion007 Skylion007 requested review from rwgk and henryiii March 2, 2022 18:10
@Skylion007 Skylion007 marked this pull request as ready for review March 2, 2022 18:11
@Skylion007 Skylion007 closed this Mar 2, 2022
@Skylion007 Skylion007 reopened this Mar 2, 2022
@Skylion007 Skylion007 changed the title (fix): Fix potential memory leak pypy fix: Fix potential memory leak pypy Mar 2, 2022
@henryiii henryiii merged commit af08a95 into pybind:master Mar 2, 2022
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Mar 2, 2022
henryiii pushed a commit to henryiii/pybind11 that referenced this pull request Mar 2, 2022
henryiii pushed a commit that referenced this pull request Mar 2, 2022
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Mar 29, 2022
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.

3 participants