From: Benjamin Peterson Date: Fri, 1 Jun 2012 18:18:22 +0000 (-0700) Subject: check return for error X-Git-Tag: v3.3.0b1~313 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1ab6089ff2b4f1277676a5feac11d311b2c52ab;p=python check return for error --- diff --git a/Python/ceval.c b/Python/ceval.c index 718bb32b56..b3ec013e17 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3107,6 +3107,8 @@ format_missing(const char *kind, PyCodeObject *co, PyObject *names) tail = PyUnicode_FromFormat(", %U, and %U", PyList_GET_ITEM(names, len - 2), PyList_GET_ITEM(names, len - 1)); + if (tail == NULL) + return; /* Chop off the last two objects in the list. This shouldn't actually fail, but we can't be too careful. */ err = PyList_SetSlice(names, len - 2, len, NULL);