lazymanifest: avoid 'bail' label when used on success path
3d485727e45e (lazymanifest: extract function for iterating to next
line, 2015-03-11) introduced a large memory leak because I stopped
running the 'bail' block in the successful case. Let's rename 'bail'
to 'done', since it has to run not only in the error case.
--- a/mercurial/manifest.c Wed May 06 13:15:39 2015 -0400
+++ b/mercurial/manifest.c Sun Apr 12 07:12:39 2015 -0700
@@ -235,7 +235,7 @@
PyObject *ret = NULL, *path = NULL, *hash = NULL, *flags = NULL;
l = lmiter_nextline((lmIter *)o);
if (!l) {
- goto bail;
+ goto done;
}
pl = pathlen(l);
path = PyString_FromStringAndSize(l->start, pl);
@@ -244,10 +244,10 @@
flags = PyString_FromStringAndSize(l->start + consumed,
l->len - consumed - 1);
if (!path || !hash || !flags) {
- goto bail;
+ goto done;
}
ret = PyTuple_Pack(3, path, hash, flags);
- bail:
+ done:
Py_XDECREF(path);
Py_XDECREF(hash);
Py_XDECREF(flags);