bpo-46857: Fix refleak in OSError INIT_ALIAS() (GH-31594)

_Py_GetRefTotal() no longer decrements _PySet_Dummy refcount.
This commit is contained in:
Victor Stinner 2022-02-27 00:28:24 +01:00 committed by GitHub
parent e182c660b6
commit ad56919c5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 18 deletions

View file

@ -61,12 +61,7 @@ Py_ssize_t _Py_RefTotal;
Py_ssize_t
_Py_GetRefTotal(void)
{
PyObject *o;
Py_ssize_t total = _Py_RefTotal;
o = _PySet_Dummy;
if (o != NULL)
total -= Py_REFCNT(o);
return total;
return _Py_RefTotal;
}
void