summaryrefslogtreecommitdiffstats
path: root/Objects/genericaliasobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/genericaliasobject.c')
-rw-r--r--Objects/genericaliasobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c
index f5fefd6..96c9649 100644
--- a/Objects/genericaliasobject.c
+++ b/Objects/genericaliasobject.c
@@ -563,6 +563,10 @@ ga_getitem(PyObject *self, PyObject *item)
}
PyObject *res = Py_GenericAlias(alias->origin, newargs);
+ if (res == NULL) {
+ Py_DECREF(newargs);
+ return NULL;
+ }
((gaobject *)res)->starred = alias->starred;
Py_DECREF(newargs);