# HG changeset patch # User Martin von Zweigbergk # Date 1428847959 25200 # Node ID 46408b80c3a127cb173609298ec065e408e31cbe # Parent 4c4d0012db4fc0bfe182a708233dd300fd444913 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. diff -r 4c4d0012db4f -r 46408b80c3a1 mercurial/manifest.c --- 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);