[3.12] gh-121660: Fix ga_getitem by explicitly checking for NULL result (GH-121661) (#121762)

gh-121660: Fix `ga_getitem` by explicitly checking for `NULL` result (GH-121661)
(cherry picked from commit bb802db8cf)

Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2024-07-14 13:37:00 +02:00 committed by GitHub
parent 004758e3a4
commit 7a4b55d602
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -564,6 +564,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);