diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 8b3438e4e37..888a498d30a 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -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; }