Uh oh!
There was an error while loading. Please reload this page.
bpo-40645: Fix reference leak in the _hashopenssl extension - #26072
Conversation
The PyModule_AddObjectRef function doesn't steal a reference, so an extra Py_DECREF is needed.
tiran
commented
May 12, 2021
Thank you! |
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.
Decref in case PyModule_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; | |
| } |
miss-islington
commented
May 12, 2021
@encukou: Status check is done, and it's a success ✅ . |
miss-islington
commented
May 12, 2021
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
miss-islington
commented
May 12, 2021
Sorry @encukou, I had trouble checking out the |
Mariatta
commented
Jun 2, 2021
Does this still need backport to 3.10? |
erlend-aasland
commented
Jun 3, 2021
I believe so, yes. cc @pablogsal. |
pablogsal
commented
Jun 3, 2021
This indeed need to be backported |
erlend-aasland
commented
Jun 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
commented
Jun 4, 2021
It is. Thank you! |
erlend-aasland
commented
Jun 4, 2021
Oh, I already did this in #26082 :) Backport is done; no further actions needed. |
The
PyModule_AddObjectReffunction doesn't steal a reference, so an extraPy_DECREFis needed.https://bugs.python.org/issue40645
Automerge-Triggered-By: GH:tiran