diff --git a/HISTORY.rst b/HISTORY.rst index adcaaa459..55c6b2b95 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -33,6 +33,8 @@ XXXX-XX-XX by Xuehai Pan) - 1953_: [Windows] disk_partitions() crashes due to insufficient buffer len. (patch by MaWe2019) +- 1965_: [Windows] fix "Fatal Python error: deallocating None" when calling + psutil.users() multiple times. - 1991_: process_iter() can raise TypeError if invoked from multiple threads (not thread-safe). diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c index 13cf58c48..8abd8a8d7 100644 --- a/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c @@ -1252,6 +1252,7 @@ psutil_users(PyObject *self, PyObject *args) { goto error; } else { + Py_INCREF(Py_None); py_address = Py_None; }