From: Fredrik Lundh Date: Sun, 27 Aug 2000 21:32:46 +0000 (+0000) Subject: oops. accidentally reintroduced a memory leak. put the bugfix back. X-Git-Tag: v2.0b1~196 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e67d8e514f7d7b49faec3e5a181c7019f07467ba;p=thirdparty%2FPython%2Fcpython.git oops. accidentally reintroduced a memory leak. put the bugfix back. --- diff --git a/Modules/_sre.c b/Modules/_sre.c index f5698f14778c..61ee694ad42b 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);