diff options
author | Riccardo Schirone <ret2libc@users.noreply.github.com> | 2019-11-18 15:51:39 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2019-11-18 22:51:39 +0800 |
commit | 3a9bccfd2c6d2e6538298cd3892058b1204056e0 (patch) | |
tree | e0ac48f0060389bcd7473d3d40d5988be5a0bb46 | |
parent | 7d512c8e4442a896d56505be3e78f1156f443465 (diff) | |
download | psutil-3a9bccfd2c6d2e6538298cd3892058b1204056e0.tar.gz |
psutil/_psutil_posix.c: better clear variables to ensure they are NULL (#1624)
-rw-r--r-- | psutil/_psutil_posix.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c index 209e787d..aa600849 100644 --- a/psutil/_psutil_posix.c +++ b/psutil/_psutil_posix.c @@ -324,11 +324,11 @@ psutil_net_if_addrs(PyObject* self, PyObject* args) { goto error; if (PyList_Append(py_retlist, py_tuple)) goto error; - Py_DECREF(py_tuple); - Py_DECREF(py_address); - Py_DECREF(py_netmask); - Py_DECREF(py_broadcast); - Py_DECREF(py_ptp); + Py_CLEAR(py_tuple); + Py_CLEAR(py_address); + Py_CLEAR(py_netmask); + Py_CLEAR(py_broadcast); + Py_CLEAR(py_ptp); } freeifaddrs(ifaddr); |