gh-81057: Fix a Reference Leak in the posix Module (gh-100140)

The leak was introduced in gh-100082.

https://github.com/python/cpython/issues/81057
This commit is contained in:
Eric Snow 2022-12-09 10:18:29 -07:00 committed by GitHub
parent 8d0bd93ae2
commit 7a0f3c1d92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2242,6 +2242,7 @@ statresult_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
}
_posixstate *state = get_posix_state(mod);
Py_DECREF(mod);
if (state == NULL) {
return NULL;
}