Commit 49a8b754 authored by Vladimir Marangozov's avatar Vladimir Marangozov

Fix in PyList_New(). With GC enabled and when out of memory,

free() the GC pointer, not the object pointer.
parent a7a6683f
...@@ -60,7 +60,7 @@ PyList_New(int size) ...@@ -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();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment