bpo-40645: Fix reference leak in the _hashopenssl extension (GH-26072)

The `PyModule_AddObjectRef` function doesn't steal a reference, so an extra `Py_DECREF` is needed.

Automerge-Triggered-By: GH:tiran
This commit is contained in:
Petr Viktorin 2021-05-12 18:04:34 +02:00 committed by GitHub
parent c40486a32d
commit 3611db53f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -2109,6 +2109,7 @@ hashlib_init_constructors(PyObject *module)
if (PyModule_AddObjectRef(module, "_constructors", proxy) < 0) {
return -1;
}
Py_DECREF(proxy);
return 0;
}