From e67d8e514f7d7b49faec3e5a181c7019f07467ba Mon Sep 17 00:00:00 2001 From: Fredrik Lundh Date: Sun, 27 Aug 2000 21:32:46 +0000 Subject: oops. accidentally reintroduced a memory leak. put the bugfix back. --- Modules/_sre.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/_sre.c b/Modules/_sre.c index f5698f1..61ee694 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -1704,10 +1704,11 @@ pattern_findall(PatternObject* self, PyObject* args) break; } - if (PyList_Append(list, item) < 0) { - Py_DECREF(item); + status = PyList_Append(list, item); + Py_DECREF(item); + + if (status < 0) goto error; - } if (state.ptr == state.start) state.start = (void*) ((char*) state.ptr + state.charsize); -- cgit v0.12