Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e67d8e5

Browse files
author
Fredrik Lundh
committed
oops. accidentally reintroduced a memory leak. put the bugfix back.
1 parent 33accc1 commit e67d8e5

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Modules/_sre.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,10 +1704,11 @@ pattern_findall(PatternObject* self, PyObject* args)
17041704
break;
17051705
}
17061706

1707-
if (PyList_Append(list, item) < 0) {
1708-
Py_DECREF(item);
1707+
status = PyList_Append(list, item);
1708+
Py_DECREF(item);
1709+
1710+
if (status < 0)
17091711
goto error;
1710-
}
17111712

17121713
if (state.ptr == state.start)
17131714
state.start = (void*) ((char*) state.ptr + state.charsize);

0 commit comments

Comments
 (0)