diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2021-10-05 18:53:42 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2021-10-05 18:53:42 +0200 |
commit | a02ebdedc945fedb7173edfed5ad4d6f7a04a760 (patch) | |
tree | d49a503107ffb45db10d6f2ec570e23f6d5575e0 | |
parent | 71e56f7141caa8cc451be23998d250c62b58f5a1 (diff) | |
download | psutil-a02ebdedc945fedb7173edfed5ad4d6f7a04a760.tar.gz |
fix #1965 / win / users() / critical: Py_INCREF(Py_None) before setting None object in C
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
-rw-r--r-- | HISTORY.rst | 2 | ||||
-rw-r--r-- | psutil/_psutil_windows.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/HISTORY.rst b/HISTORY.rst index adcaaa45..55c6b2b9 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 13cf58c4..8abd8a8d 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; } |