32 lines
1.0 KiB
Diff
32 lines
1.0 KiB
Diff
From 3a9bccfd2c6d2e6538298cd3892058b1204056e0 Mon Sep 17 00:00:00 2001
|
|
From: Riccardo Schirone <ret2libc@users.noreply.github.com>
|
|
Date: Mon, 18 Nov 2019 15:51:39 +0100
|
|
Subject: [PATCH] psutil/_psutil_posix.c: better clear variables to ensure they
|
|
are NULL (#1624)
|
|
|
|
---
|
|
psutil/_psutil_posix.c | 10 +++++-----
|
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c
|
|
index 209e787d5..aa6008491 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);
|