From: Vladimir Marangozov Date: Sat, 15 Jul 2000 03:31:31 +0000 (+0000) Subject: Fix in PyList_New(). With GC enabled and when out of memory, X-Git-Tag: v2.0b1~820 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=467a67e74d9ead0440cffb58d5fc299e477b26f0;p=thirdparty%2FPython%2Fcpython.git Fix in PyList_New(). With GC enabled and when out of memory, free() the GC pointer, not the object pointer. --- diff --git a/Objects/listobject.c b/Objects/listobject.c index e85e2f49bf2f..52640fb08377 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -60,7 +60,7 @@ PyList_New(int size) else { op->ob_item = (PyObject **) PyMem_MALLOC(nbytes); if (op->ob_item == NULL) { - PyObject_FREE(op); + PyObject_FREE(PyObject_AS_GC(op)); return PyErr_NoMemory(); } }