diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-07-11 22:53:26 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-07-11 22:53:26 (GMT) |
commit | 8ca72e2e3dfd0643288c27c4462cb8be62b5b049 (patch) | |
tree | 96cd627f1291a6d902e918ba95abdfae7f4097df /Modules/_pickle.c | |
parent | a41f08514463ffe1f985e1ef5b3e9123e7222dc5 (diff) | |
download | cpython-8ca72e2e3dfd0643288c27c4462cb8be62b5b049.zip cpython-8ca72e2e3dfd0643288c27c4462cb8be62b5b049.tar.gz cpython-8ca72e2e3dfd0643288c27c4462cb8be62b5b049.tar.bz2 |
Issue #18408: _PyMemoTable_ResizeTable() now restores the old table if
allocating a bigger table failed
PyMemoTable destructor does crash if mt_table is NULL.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r-- | Modules/_pickle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 8b3438e..888a498 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; } |