summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-08-27 21:32:46 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2000-08-27 21:32:46 (GMT)
commite67d8e514f7d7b49faec3e5a181c7019f07467ba (patch)
treed240e8f909e24c7e834fd7c5480bdc8f4249321f /Modules
parent33accc1f5c4c8122b5dc6b207b2c4c80ac37f7b7 (diff)
downloadcpython-e67d8e514f7d7b49faec3e5a181c7019f07467ba.zip
cpython-e67d8e514f7d7b49faec3e5a181c7019f07467ba.tar.gz
cpython-e67d8e514f7d7b49faec3e5a181c7019f07467ba.tar.bz2
oops. accidentally reintroduced a memory leak. put the bugfix back.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_sre.c7
1 files 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);