Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
bpo-40645: Fix reference leak in the _hashopenssl extension#26072
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The PyModule_AddObjectRef function doesn't steal a reference,so an extra Py_DECREF is needed.
tiran commentedMay 12, 2021
Thank you! |
erlend-aasland commentedMay 12, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There's also three leaks in the preceding for-loop: |
| if (PyModule_AddObjectRef(module,"_constructors",proxy)<0) { | ||
| return-1; | ||
| } | ||
| Py_DECREF(proxy); |
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.
Decref in casePyModule_AddObjectRef fails, no?
| if (PyModule_AddObjectRef(module,"_constructors",proxy)<0) { | |
| return-1; | |
| } | |
| Py_DECREF(proxy); | |
| intrc=PyModule_AddObjectRef(module,"_constructors",proxy); | |
| Py_DECREF(proxy); | |
| if (rc<0) { | |
| return-1; | |
| } |
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.
FYI, fixed in#26079
miss-islington commentedMay 12, 2021
@encukou: Status check is done, and it's a success ✅ . |
miss-islington commentedMay 12, 2021
Thanks@encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
miss-islington commentedMay 12, 2021
Sorry@encukou, I had trouble checking out the |
Mariatta commentedJun 2, 2021
Does this still need backport to 3.10? |
erlend-aasland commentedJun 3, 2021
I believe so, yes. cc@pablogsal. |
pablogsal commentedJun 3, 2021
This indeed need to be backported |
erlend-aasland commentedJun 3, 2021
I can create a backport of this together with a backport of#26079,@pablogsal. Let me know if that's ok with you,@encukou. |
encukou commentedJun 4, 2021
It is. Thank you! |
erlend-aasland commentedJun 4, 2021
Oh, I already did this in#26082 :) Backport is done; no further actions needed. |
Uh oh!
There was an error while loading.Please reload this page.
The
PyModule_AddObjectReffunction doesn't steal a reference, so an extraPy_DECREFis needed.https://bugs.python.org/issue40645
Automerge-Triggered-By: GH:tiran