From 304e928430ce3ce77985281cae4fb19905884552 Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Jun 17 2019 14:05:45 +0000 Subject: python: Use Py_CLEAR Instead of: Py_DECREF(obj); obj = NULL; We can use: Py_CLEAR(obj); Signed-off-by: Nir Soffer --- diff --git a/python/sanlock.c b/python/sanlock.c index e740f89..21a7a76 100644 --- a/python/sanlock.c +++ b/python/sanlock.c @@ -1563,8 +1563,7 @@ py_get_event(PyObject *self __unused, PyObject *args) if (PyList_Append(events, item) != 0) goto exit_fail; - Py_DECREF(item); - item = NULL; + Py_CLEAR(item); } return events;