Skip to content

[3.7] bpo-16575: Fix refleak on passing unions in ctypes #17064

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
Nov 6, 2019

Conversation

ammaraskar
Copy link
Member

@ammaraskar ammaraskar commented Nov 5, 2019

The master and 3.8 versions of the previous change work as expected
because we perform the lookup for the from_param after the union
check. However, in 3.7, this lookup happens before the union
validation and so we must decrease the reference for cnv before
returning.

https://bugs.python.org/issue16575

The master and 3.8 versions of the previous change work as expected
because we perform the lookup for the `from_param` after the union
check. However, in 3.7, this lookup happens before the union
validation and so we must decrease the reference for `cnv` before
returning.
@ammaraskar ammaraskar changed the title bpo-16575: Fix refleak on passing unions in ctypes [3.7] bpo-16575: Fix refleak on passing unions in ctypes Nov 5, 2019
@ammaraskar ammaraskar requested a review from vstinner November 5, 2019 19:05
@vsajip
Copy link
Member

vsajip commented Nov 5, 2019

Thanks for catching it!

@vsajip
Copy link
Member

vsajip commented Nov 6, 2019

@vstinner if you've no objections, I plan to merge this soon, as the fix looks OK to me.

@vsajip vsajip merged commit 484edbf into python:3.7 Nov 6, 2019
@arigo arigo mannequin mentioned this pull request Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants