Kaydet (Commit) 8ca72e2e authored tarafından Victor Stinner's avatar Victor Stinner

Issue #18408: _PyMemoTable_ResizeTable() now restores the old table if

allocating a bigger table failed

PyMemoTable destructor does crash if mt_table is NULL.
üst a41f0851
......@@ -529,7 +529,7 @@ _PyMemoTable_ResizeTable(PyMemoTable *self, Py_ssize_t min_size)
oldtable = self->mt_table;
self->mt_table = PyMem_MALLOC(new_size * sizeof(PyMemoEntry));
if (self->mt_table == NULL) {
PyMem_FREE(oldtable);
self->mt_table = oldtable;
PyErr_NoMemory();
return -1;
}
......
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