summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index b9ef0d0..3642b39 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -1924,8 +1924,10 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
keys = &ms.temparray[saved_ob_size+1];
else {
keys = PyMem_MALLOC(sizeof(PyObject *) * saved_ob_size);
- if (keys == NULL)
- return NULL;
+ if (keys == NULL) {
+ PyErr_NoMemory();
+ goto keyfunc_fail;
+ }
}
for (i = 0; i < saved_ob_size ; i++) {