lazymanifest: fix memory leak in lmiter_iterentriesnext() after 3d485727e45e
authorMike Hommey <mh@glandium.org>
Sun, 12 Apr 2015 06:51:13 -0700
changeset 24699 64cd23a1bc13
parent 24698 a85c4ed1132f
child 24700 32b268cbff00
lazymanifest: fix memory leak in lmiter_iterentriesnext() after 3d485727e45e
mercurial/manifest.c
--- a/mercurial/manifest.c	Sat Apr 11 12:26:54 2015 -0400
+++ b/mercurial/manifest.c	Sun Apr 12 06:51:13 2015 -0700
@@ -232,7 +232,7 @@
 	size_t pl;
 	line *l;
 	Py_ssize_t consumed;
-	PyObject *path = NULL, *hash = NULL, *flags = NULL;
+	PyObject *ret = NULL, *path = NULL, *hash = NULL, *flags = NULL;
 	l = lmiter_nextline((lmIter *)o);
 	if (!l) {
 		goto bail;
@@ -246,12 +246,12 @@
 	if (!path || !hash || !flags) {
 		goto bail;
 	}
-	return PyTuple_Pack(3, path, hash, flags);
+	ret = PyTuple_Pack(3, path, hash, flags);
  bail:
 	Py_XDECREF(path);
 	Py_XDECREF(hash);
 	Py_XDECREF(flags);
-	return NULL;
+	return ret;
 }
 
 static PyTypeObject lazymanifestEntriesIterator = {