diff --git a/Modules/_csv.c b/Modules/_csv.c index 22ac2667ff0..183a9a5edb4 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -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; }