mirror of
https://github.com/python/cpython.git
synced 2025-10-18 04:38:07 +00:00
Fix in PyList_New(). With GC enabled and when out of memory,
free() the GC pointer, not the object pointer.
This commit is contained in:
parent
5ff2ac2fa9
commit
467a67e74d
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ PyList_New(int size)
|
||||||
else {
|
else {
|
||||||
op->ob_item = (PyObject **) PyMem_MALLOC(nbytes);
|
op->ob_item = (PyObject **) PyMem_MALLOC(nbytes);
|
||||||
if (op->ob_item == NULL) {
|
if (op->ob_item == NULL) {
|
||||||
PyObject_FREE(op);
|
PyObject_FREE(PyObject_AS_GC(op));
|
||||||
return PyErr_NoMemory();
|
return PyErr_NoMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue