Mercurial > cpython-lru_cache-weakref
diff Modules/_csv.c @ 87104:c9efe992e9b2
Issue #19437: Fix parse_save_field() of the csv module, handle PyList_Append()
failure
| author | Victor Stinner <victor.stinner@gmail.com> |
|---|---|
| date | Thu, 14 Nov 2013 21:29:34 +0100 |
| parents | ced9602a3710 |
| children |
line wrap: on
line diff
--- a/Modules/_csv.c Thu Nov 14 23:50:51 2013 +0200 +++ b/Modules/_csv.c Thu Nov 14 21:29:34 2013 +0100 @@ -546,7 +546,10 @@ 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; }
