Skip to content

Commit

Permalink
bpo-40645: Fix reference leak in the _hashopenssl extension (GH-26072)
Browse files Browse the repository at this point in the history
The `PyModule_AddObjectRef` function doesn't steal a reference, so an extra `Py_DECREF` is needed.

Automerge-Triggered-By: GH:tiran
  • Loading branch information
encukou committed May 12, 2021
1 parent c40486a commit 3611db5
Showing 1 changed file with 1 addition and 0 deletions.
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);
return 0;
}

Expand Down

0 comments on commit 3611db5

Please sign in to comment.