mirror of
https://github.com/python/cpython.git
synced 2026-05-18 10:24:42 -04:00
Handle more mem alloc issues found with failmalloc
This commit is contained in:
+3
-1
@@ -121,8 +121,10 @@ PyFuture_FromAST(mod_ty mod, const char *filename)
|
||||
PyFutureFeatures *ff;
|
||||
|
||||
ff = (PyFutureFeatures *)PyObject_Malloc(sizeof(PyFutureFeatures));
|
||||
if (ff == NULL)
|
||||
if (ff == NULL) {
|
||||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
}
|
||||
ff->ff_features = 0;
|
||||
ff->ff_lineno = -1;
|
||||
|
||||
|
||||
@@ -529,6 +529,8 @@ update_symbols(PyObject *symbols, PyObject *scope,
|
||||
i = PyInt_AS_LONG(w);
|
||||
flags |= (i << SCOPE_OFF);
|
||||
u = PyInt_FromLong(flags);
|
||||
if (!u)
|
||||
return 0;
|
||||
if (PyDict_SetItem(symbols, name, u) < 0) {
|
||||
Py_DECREF(u);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user