From: Neal Norwitz Date: Sat, 15 Mar 2008 22:36:01 +0000 (+0000) Subject: Handle memory allocation failure. Found by Adam Olsen X-Git-Tag: v2.6a2~315 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5becac576c18541e09e88c536e6ca71257a283f0;p=thirdparty%2FPython%2Fcpython.git Handle memory allocation failure. Found by Adam Olsen --- diff --git a/Python/symtable.c b/Python/symtable.c index 56e187a7d156..6318324d5c9b 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -27,8 +27,9 @@ PySTEntry_New(struct symtable *st, identifier name, _Py_block_ty block, k = PyLong_FromVoidPtr(key); if (k == NULL) goto fail; - ste = (PySTEntryObject *)PyObject_New(PySTEntryObject, - &PySTEntry_Type); + ste = PyObject_New(PySTEntryObject, &PySTEntry_Type); + if (ste == NULL) + goto fail; ste->ste_table = st; ste->ste_id = k; ste->ste_tmpname = 0;