diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2008-03-15 22:36:01 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2008-03-15 22:36:01 (GMT) |
commit | 5becac576c18541e09e88c536e6ca71257a283f0 (patch) | |
tree | 9e76a487eb3c37a2e71c4a30bd5abcb882b827a0 /Python | |
parent | 400aedacc06ac33c2bb488f3f95a90f11e96e168 (diff) | |
download | cpython-5becac576c18541e09e88c536e6ca71257a283f0.zip cpython-5becac576c18541e09e88c536e6ca71257a283f0.tar.gz cpython-5becac576c18541e09e88c536e6ca71257a283f0.tar.bz2 |
Handle memory allocation failure. Found by Adam Olsen
Diffstat (limited to 'Python')
-rw-r--r-- | Python/symtable.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 56e187a..6318324 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; |