Skip to content

Commit 97b06d5

Browse files
[3.13] gh-121660: Fix ga_getitem by explicitly checking for NULL result (GH-121661) (#121761)
gh-121660: Fix `ga_getitem` by explicitly checking for `NULL` result (GH-121661) (cherry picked from commit bb802db) Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent 295b791 commit 97b06d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Objects/genericaliasobject.c

+4
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,10 @@ ga_getitem(PyObject *self, PyObject *item)
561561
}
562562

563563
PyObject *res = Py_GenericAlias(alias->origin, newargs);
564+
if (res == NULL) {
565+
Py_DECREF(newargs);
566+
return NULL;
567+
}
564568
((gaobject *)res)->starred = alias->starred;
565569

566570
Py_DECREF(newargs);

0 commit comments

Comments
 (0)