Instead of:
Py_DECREF(obj);
obj = NULL;
We can use:
Py_CLEAR(obj);
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/sanlock.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/python/sanlock.c b/python/sanlock.c
index e740f89..21a7a76 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -1561,12 +1561,11 @@ py_get_event(PyObject *self __unused, PyObject *args)
goto exit_fail;
if (PyList_Append(events, item) != 0)
goto exit_fail;
- Py_DECREF(item);
- item = NULL;
+ Py_CLEAR(item);
}
return events;
exit_fail:
--
2.17.2