summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Schirone <ret2libc@users.noreply.github.com>2019-11-18 15:51:39 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2019-11-18 22:51:39 +0800
commit3a9bccfd2c6d2e6538298cd3892058b1204056e0 (patch)
treee0ac48f0060389bcd7473d3d40d5988be5a0bb46
parent7d512c8e4442a896d56505be3e78f1156f443465 (diff)
downloadpsutil-3a9bccfd2c6d2e6538298cd3892058b1204056e0.tar.gz
psutil/_psutil_posix.c: better clear variables to ensure they are NULL (#1624)
-rw-r--r--psutil/_psutil_posix.c10
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);