Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
miss-islington merged 1 commit intopython:mainfromencukou:hashlib-refleak
May 12, 2021
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-40645: Fix reference leaks in the _hashopenssl initialization
The PyModule_AddObjectRef function doesn't steal a reference,so an extra Py_DECREF is needed.
  • Loading branch information
@encukou
encukou committedMay 12, 2021
commitff1f720dcbbfa12aa6b8cb1575ec4832c9c6685a
1 change: 1 addition & 0 deletionsModules/_hashopenssl.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2109,6 +2109,7 @@ hashlib_init_constructors(PyObject *module)
if (PyModule_AddObjectRef(module, "_constructors", proxy) < 0) {
return -1;
}
Py_DECREF(proxy);
Comment on lines 2109 to +2112
Copy link
Contributor

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?

Suggested change
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;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, fixed in#26079

return 0;
}

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp