Use Py_NewRef in Modules/_struct.c (GH-23981)

This commit is contained in:
Pablo Galindo 2020-12-28 23:59:16 +00:00 committed by GitHub
parent 4140f10a16
commit 290f5ae997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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;