Issue #19437: Fix parse_save_field() of the csv module, handle PyList_Append()

failure
This commit is contained in:
Victor Stinner 2013-11-14 21:29:34 +01:00
parent 1eadd6a120
commit b80b378680
1 changed files with 4 additions and 1 deletions

View File

@ -546,7 +546,10 @@ parse_save_field(ReaderObj *self)
return -1; return -1;
field = tmp; field = tmp;
} }
PyList_Append(self->fields, field); if (PyList_Append(self->fields, field) < 0) {
Py_DECREF(field);
return -1;
}
Py_DECREF(field); Py_DECREF(field);
return 0; return 0;
} }