Fix memory error treatment correctly. Going to dsu_fail causes

deallocating garbage pointers; saved_ob_item and empty_ob_item.
(Reviewed by Raymond Hettinger)
This commit is contained in:
Hye-Shik Chang 2003-12-10 07:31:08 +00:00
parent e807da807c
commit 19cb193244

View file

@ -1866,7 +1866,7 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
if (compare != NULL && keyfunc != NULL) { if (compare != NULL && keyfunc != NULL) {
compare = build_cmpwrapper(compare); compare = build_cmpwrapper(compare);
if (compare == NULL) if (compare == NULL)
goto dsu_fail; return NULL;
} else } else
Py_XINCREF(compare); Py_XINCREF(compare);