Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5de9842 commit fa8efabCopy full SHA for fa8efab
1 file changed
Modules/gcmodule.c
@@ -878,15 +878,19 @@ PyObject *
878
_PyObject_GC_New(PyTypeObject *tp)
879
{
880
PyObject *op = _PyObject_GC_Malloc(_PyObject_SIZE(tp));
881
- return PyObject_INIT(op, tp);
+ if (op != NULL)
882
+ op = PyObject_INIT(op, tp);
883
+ return op;
884
}
885
886
PyVarObject *
887
_PyObject_GC_NewVar(PyTypeObject *tp, int nitems)
888
889
const size_t size = _PyObject_VAR_SIZE(tp, nitems);
890
PyVarObject *op = (PyVarObject *) _PyObject_GC_Malloc(size);
- return PyObject_INIT_VAR(op, tp, nitems);
891
892
+ op = PyObject_INIT_VAR(op, tp, nitems);
893
894
895
896
0 commit comments