Skip to content
Merged
Changes from all 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
1 change: 1 addition & 0 deletions Modules/_hashopenssl.c
Original file line number Diff line number Diff 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 case PyModule_AddObjectRef fails, no?

Suggested change
if (PyModule_AddObjectRef(module, "_constructors", proxy) < 0) {
return -1;
}
Py_DECREF(proxy);
int rc = 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