parsers: don't leak a tuple in pack_dirstate stable
authorAugie Fackler <augie@google.com>
Fri, 23 Jan 2015 15:48:18 -0500
branchstable
changeset 23946 f3e94aa6e182
parent 23945 33d6aaf84c9e
child 23947 2cb49fba9736
parsers: don't leak a tuple in pack_dirstate Spotted with cpychecker.
mercurial/parsers.c
--- a/mercurial/parsers.c	Fri Jan 23 15:41:46 2015 -0500
+++ b/mercurial/parsers.c	Fri Jan 23 15:48:18 2015 -0500
@@ -410,7 +410,7 @@
 	PyObject *packobj = NULL;
 	PyObject *map, *copymap, *pl, *mtime_unset = NULL;
 	Py_ssize_t nbytes, pos, l;
-	PyObject *k, *v, *pn;
+	PyObject *k, *v = NULL, *pn;
 	char *p, *s;
 	double now;
 
@@ -527,6 +527,7 @@
 bail:
 	Py_XDECREF(mtime_unset);
 	Py_XDECREF(packobj);
+	Py_XDECREF(v);
 	return NULL;
 }