mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #19437: Fix parse_save_field() of the csv module, handle PyList_Append()
failure
This commit is contained in:
parent
1eadd6a120
commit
b80b378680
1 changed files with 4 additions and 1 deletions
|
@ -546,7 +546,10 @@ parse_save_field(ReaderObj *self)
|
|||
return -1;
|
||||
field = tmp;
|
||||
}
|
||||
PyList_Append(self->fields, field);
|
||||
if (PyList_Append(self->fields, field) < 0) {
|
||||
Py_DECREF(field);
|
||||
return -1;
|
||||
}
|
||||
Py_DECREF(field);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue