commit | e0cf624747a35a6db2f632607e7788b8e66d0954 | [log] [tgz] |
---|---|---|
author | Neal Norwitz <nnorwitz@gmail.com> | Sat Oct 28 21:39:10 2006 +0000 |
committer | Neal Norwitz <nnorwitz@gmail.com> | Sat Oct 28 21:39:10 2006 +0000 |
tree | 0c565f7d5ca49e8b23ab3e8b504e8f03e1239709 | |
parent | 2f0940b6cab766f039dc22d361f52e25b22e9fa8 [diff] |
Backport 52505: Prevent crash if alloc of garbage fails. Found by Typo.pl.
diff --git a/Objects/listobject.c b/Objects/listobject.c index 7afea12..739a571 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c
@@ -2606,6 +2606,11 @@ garbage = (PyObject**) PyMem_MALLOC(slicelength*sizeof(PyObject*)); + if (!garbage) { + Py_DECREF(seq); + PyErr_NoMemory(); + return -1; + } selfitems = self->ob_item; seqitems = PySequence_Fast_ITEMS(seq);