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 8c2c3d3 commit 8c18f25Copy full SHA for 8c18f25
1 file changed
Modules/gcmodule.c
@@ -802,8 +802,9 @@ _PyObject_GC_Malloc(PyTypeObject *tp, int size)
802
{
803
PyObject *op;
804
#ifdef WITH_CYCLE_GC
805
- PyGC_Head *g = PyObject_MALLOC(_PyObject_VAR_SIZE(tp, size) +
806
- sizeof(PyGC_Head));
+ const size_t nbytes = sizeof(PyGC_Head) +
+ (size_t)_PyObject_VAR_SIZE(tp, size);
807
+ PyGC_Head *g = PyObject_MALLOC(nbytes);
808
if (g == NULL)
809
return (PyObject *)PyErr_NoMemory();
810
g->gc_next = NULL;
0 commit comments