Skip to content

Commit 8f038ff

Browse files
author
neal.norwitz
committed
Handle memory allocation failure. Found by Adam Olsen
git-svn-id: http://svn.python.org/projects/python/trunk@61407 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 2f593cb commit 8f038ff

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Python/symtable.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ PySTEntry_New(struct symtable *st, identifier name, _Py_block_ty block,
2727
k = PyLong_FromVoidPtr(key);
2828
if (k == NULL)
2929
goto fail;
30-
ste = (PySTEntryObject *)PyObject_New(PySTEntryObject,
31-
&PySTEntry_Type);
30+
ste = PyObject_New(PySTEntryObject, &PySTEntry_Type);
31+
if (ste == NULL)
32+
goto fail;
3233
ste->ste_table = st;
3334
ste->ste_id = k;
3435
ste->ste_tmpname = 0;

0 commit comments

Comments
 (0)