mirror of
https://github.com/python/cpython
synced 2024-09-15 23:46:26 +00:00
gh-101967: add a missing error check (#101968)
This commit is contained in:
parent
7f1c721756
commit
89413bbccb
|
@ -0,0 +1 @@
|
|||
Fix possible segfault in ``positional_only_passed_as_keyword`` function, when new list created.
|
|
@ -1255,7 +1255,9 @@ positional_only_passed_as_keyword(PyThreadState *tstate, PyCodeObject *co,
|
|||
{
|
||||
int posonly_conflicts = 0;
|
||||
PyObject* posonly_names = PyList_New(0);
|
||||
|
||||
if (posonly_names == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
for(int k=0; k < co->co_posonlyargcount; k++){
|
||||
PyObject* posonly_name = PyTuple_GET_ITEM(co->co_localsplusnames, k);
|
||||
|
||||
|
|
Loading…
Reference in a new issue