diff options
author | Jakub Bacic <jakub.bacic@gmail.com> | 2017-10-11 16:23:46 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-10-11 16:23:46 +0200 |
commit | 9c75262c01266a3e2e31cd09d5d9c710d0270e18 (patch) | |
tree | 3003b0a3c52226297efddf2f3360b0bf381af928 | |
parent | 632dac16e9a3d8cb79270dabe7033143b0b112ba (diff) | |
download | psutil-9c75262c01266a3e2e31cd09d5d9c710d0270e18.tar.gz |
#1127 Fix reference counting bug in open_files impl on OSX (#1144)
-rw-r--r-- | psutil/_psutil_osx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c index 450f1db0..2924aa39 100644 --- a/psutil/_psutil_osx.c +++ b/psutil/_psutil_osx.c @@ -1129,7 +1129,6 @@ psutil_proc_open_files(PyObject *self, PyObject *args) { iterations = (pidinfo_result / PROC_PIDLISTFD_SIZE); for (i = 0; i < iterations; i++) { - py_tuple = NULL; fdp_pointer = &fds_pointer[i]; if (fdp_pointer->proc_fdtype == PROX_FDTYPE_VNODE) { @@ -1167,7 +1166,9 @@ psutil_proc_open_files(PyObject *self, PyObject *args) { if (PyList_Append(py_retlist, py_tuple)) goto error; Py_DECREF(py_tuple); + py_tuple = NULL; Py_DECREF(py_path); + py_path = NULL; // --- /construct python list } } |