Issue #18408: _PyMemoTable_ResizeTable() now restores the old table if
allocating a bigger table failed PyMemoTable destructor does crash if mt_table is NULL.
This commit is contained in:
parent
a41f085144
commit
8ca72e2e3d
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue