Skip to content

Commit 20caacd

Browse files
committed
Leverage Py_CLEAR
Idea by @picnixz
1 parent 22417ec commit 20caacd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Modules/pyexpat.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,8 +1550,7 @@ xmlparse_dealloc(PyObject *op)
15501550
}
15511551
self->itself = NULL;
15521552
if (self->parent != NULL) {
1553-
Py_DECREF(self->parent);
1554-
self->parent = NULL;
1553+
Py_CLEAR(self->parent);
15551554
}
15561555

15571556
if (self->handlers != NULL) {

0 commit comments

Comments
 (0)