summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/future.c4
-rw-r--r--Python/symtable.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/Python/future.c b/Python/future.c
index 560077d..3b3ca1d 100644
--- a/Python/future.c
+++ b/Python/future.c
@@ -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;
diff --git a/Python/symtable.c b/Python/symtable.c
index c010b7a..439a243 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -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;