mirror of
https://github.com/python/cpython.git
synced 2025-09-14 04:37:29 +00:00
Handle memory allocation failure. Found by Adam Olsen
This commit is contained in:
parent
400aedacc0
commit
5becac576c
1 changed files with 3 additions and 2 deletions
|
@ -27,8 +27,9 @@ PySTEntry_New(struct symtable *st, identifier name, _Py_block_ty block,
|
||||||
k = PyLong_FromVoidPtr(key);
|
k = PyLong_FromVoidPtr(key);
|
||||||
if (k == NULL)
|
if (k == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
ste = (PySTEntryObject *)PyObject_New(PySTEntryObject,
|
ste = PyObject_New(PySTEntryObject, &PySTEntry_Type);
|
||||||
&PySTEntry_Type);
|
if (ste == NULL)
|
||||||
|
goto fail;
|
||||||
ste->ste_table = st;
|
ste->ste_table = st;
|
||||||
ste->ste_id = k;
|
ste->ste_id = k;
|
||||||
ste->ste_tmpname = 0;
|
ste->ste_tmpname = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue