summaryrefslogtreecommitdiff
path: root/lib/tdb
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2023-04-24 10:42:39 +1200
committerAndrew Bartlett <abartlet@samba.org>2023-05-16 23:29:32 +0000
commitf573177c352c2df89c7d5ffd425a37b46b12166c (patch)
tree4b1a02b7ea2cceaf9b9d1ce9ba8241ec4c0d92c4 /lib/tdb
parent8d6e4473409375f0e62dd06597ca983d22b941ca (diff)
downloadsamba-f573177c352c2df89c7d5ffd425a37b46b12166c.tar.gz
python: Safely clear structure members
Using Py_CLEAR() ensures that these structures are observed in a consistent state by any Python code that may run during deconstruction. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/tdb')
-rw-r--r--lib/tdb/pytdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tdb/pytdb.c b/lib/tdb/pytdb.c
index 85df1b18621..ed22803328c 100644
--- a/lib/tdb/pytdb.c
+++ b/lib/tdb/pytdb.c
@@ -450,7 +450,7 @@ static PyObject *tdb_iter_next(PyTdbIteratorObject *self)
static void tdb_iter_dealloc(PyTdbIteratorObject *self)
{
- Py_DECREF(self->iteratee);
+ Py_CLEAR(self->iteratee);
PyObject_Del(self);
}