8000 bpo-40737: Fix possible reference leak for sqlite3 initialization by erlend-aasland · Pull Request #20323 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-40737: 8000 Fix possible reference leak for sqlite3 initialization #20323

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 15 commits into from
May 26, 2020

Conversation

erlend-aasland
Copy link
Contributor
@erlend-aasland erlend-aasland commented May 22, 2020

According to the docs, PyModule_AddObject() only decrements the
reference count of value on success. Calling code must Py_DECREF()
manually on error.

https://bugs.python.org/issue40737

According to the docs, PyModule_AddObject() only decrements the
reference count of value _on success_.  Calling code must Py_DECREF()
manually on error.
Copy link
Member
@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with nit comment.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Erlend Egeberg Aasland and others added 9 commits May 25, 2020 17:44
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
@erlend-aasland erlend-aasland changed the title bpo-40737: Use PyModule_AddObject() correctly in sqlite3 bpo-40737: Use PyModule_AddType() in sqlite3 May 25, 2020
@erlend-aasland erlend-aasland changed the title bpo-40737: Use PyModule_AddType() in sqlite3 bpo-40737: Fix possible reference leak for sqlite3 initialization May 25, 2020
@erlend-aasland
Copy link
Contributor Author

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@corona10: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from corona10 May 25, 2020 18:23
@erlend-aasland
Copy link
Contributor Author

Should probably be backported to 3.9, @corona10.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@corona10: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from corona10 May 26, 2020 08:21
Copy link
Member
@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last review :)
It will cause the leak!

Py_INCREF(type);

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
@erlend-aasland
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@corona10: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from corona10 May 26, 2020 08:29
Copy link
Member
@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Thanks for the contribution!

@corona10 corona10 added the needs backport to 3.9 only security fixes label May 26, 2020
@corona10 corona10 merged commit 5eb45d7 into python:master May 26, 2020
@miss-islington
Copy link
Contributor

Thanks @erlend-aasland for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 26, 2020
…thonGH-20323)

(cherry picked from commit 5eb45d7)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label May 26, 2020
@bedevere-bot
Copy link

GH-20425 is a backport of this pull request to the 3.9 branch.

@erlend-aasland erlend-aasland deleted the fix-issue-40737 branch May 26, 2020 12:32
miss-islington added a commit that referenced this pull request May 26, 2020
…-20323)

(cherry picked from commit 5eb45d7)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
@erlend-aasland
Copy link
Contributor Author

Thanks for you patience and helpful comments, @corona10!

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
0