[Python-checkins] r61407 - python/trunk/Python/symtable.c

neal.norwitz python-checkins at python.org
Sat Mar 15 23:36:01 CET 2008


Author: neal.norwitz
Date: Sat Mar 15 23:36:01 2008
New Revision: 61407

Modified:
   python/trunk/Python/symtable.c
Log:
Handle memory allocation failure.  Found by Adam Olsen

Modified: python/trunk/Python/symtable.c
==============================================================================
--- python/trunk/Python/symtable.c	(original)
+++ python/trunk/Python/symtable.c	Sat Mar 15 23:36:01 2008
@@ -27,8 +27,9 @@
 	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;


More information about the Python-checkins mailing list