From: Victor Stinner Date: Thu, 11 Jul 2013 22:53:26 +0000 (+0200) Subject: Issue #18408: _PyMemoTable_ResizeTable() now restores the old table if X-Git-Tag: v3.4.0a1~239 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8ca72e2e3dfd0643288c27c4462cb8be62b5b049;p=thirdparty%2FPython%2Fcpython.git Issue #18408: _PyMemoTable_ResizeTable() now restores the old table if allocating a bigger table failed PyMemoTable destructor does crash if mt_table is NULL. --- diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 8b3438e4e372..888a498d30a2 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; }