mirror of https://github.com/python/cpython
fix possible refleaks
This commit is contained in:
parent
f6b25b9e35
commit
ae13c88d8d
|
@ -2093,8 +2093,10 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
|
||||||
PyUnicode_CompareWithASCIIString(tmp, "__weakref__") == 0))
|
PyUnicode_CompareWithASCIIString(tmp, "__weakref__") == 0))
|
||||||
continue;
|
continue;
|
||||||
tmp =_Py_Mangle(name, tmp);
|
tmp =_Py_Mangle(name, tmp);
|
||||||
if (!tmp)
|
if (!tmp) {
|
||||||
|
Py_DECREF(newslots);
|
||||||
goto bad_slots;
|
goto bad_slots;
|
||||||
|
}
|
||||||
PyList_SET_ITEM(newslots, j, tmp);
|
PyList_SET_ITEM(newslots, j, tmp);
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue