Use Py_NewRef in Modules/_struct.c (GH-23981)
This commit is contained in:
parent
4140f10a16
commit
290f5ae997
|
@ -1442,8 +1442,7 @@ s_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
self = alloc_func(type, 0);
|
||||
if (self != NULL) {
|
||||
PyStructObject *s = (PyStructObject*)self;
|
||||
Py_INCREF(Py_None);
|
||||
s->s_format = Py_None;
|
||||
s->s_format = Py_NewRef(Py_None);
|
||||
s->s_codes = NULL;
|
||||
s->s_size = -1;
|
||||
s->s_len = -1;
|
||||
|
|
Loading…
Reference in New Issue