Kaydet (Commit) 07fb92a8 authored tarafından Anthony Baxter's avatar Anthony Baxter

backport tim_one's patch:

(some tweaking for different _PyObject_GC_Malloc() call in 2.2. checked,
still returns the same thing on failure...)

_PyObject_GC_New:  Could call PyObject_INIT with a NULL 1st argument.
_PyObject_GC_NewVar:  Could call PyObject_INIT_VAR likewise.

Bugfix candidate.

Original patch(es):
python/dist/src/Modules/gcmodule.c:2.40
üst 608ee5a8
......@@ -861,14 +861,18 @@ PyObject *
_PyObject_GC_New(PyTypeObject *tp)
{
PyObject *op = _PyObject_GC_Malloc(tp, 0);
return PyObject_INIT(op, tp);
if (op != NULL)
op = PyObject_INIT(op, tp);
return op;
}
PyVarObject *
_PyObject_GC_NewVar(PyTypeObject *tp, int nitems)
{
PyVarObject *op = (PyVarObject *) _PyObject_GC_Malloc(tp, nitems);
return PyObject_INIT_VAR(op, tp, nitems);
if (op != NULL)
op = PyObject_INIT_VAR(op, tp, nitems);
return op;
}
PyVarObject *
......
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