Skip to content

Commit 3611db5

Browse files
authored
bpo-40645: Fix reference leak in the _hashopenssl extension (pythonGH-26072)
The `PyModule_AddObjectRef` function doesn't steal a reference, so an extra `Py_DECREF` is needed. Automerge-Triggered-By: GH:tiran
1 parent c40486a commit 3611db5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/_hashopenssl.c

+1
Original file line numberDiff line numberDiff line change
@@ -2109,6 +2109,7 @@ hashlib_init_constructors(PyObject *module)
21092109
if (PyModule_AddObjectRef(module, "_constructors", proxy) < 0) {
21102110
return -1;
21112111
}
2112+
Py_DECREF(proxy);
21122113
return 0;
21132114
}
21142115

0 commit comments

Comments
 (0)