Skip to content

Commit

Permalink
[3.12] gh-121660: Fix ga_getitem by explicitly checking for NULL
Browse files Browse the repository at this point in the history
…result (GH-121661) (#121762)

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

Co-authored-by: sobolevn <[email protected]>
  • Loading branch information
miss-islington and sobolevn authored Jul 14, 2024
1 parent 004758e commit 7a4b55d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Objects/genericaliasobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7a4b55d

Please sign in to comment.