changeset 23945:33d6aaf84c9e stable

parsers.c: fix a memory leak in index_commonancestorsheads Spotted with cpychecker.
author Augie Fackler <augie@google.com>
date Fri, 23 Jan 2015 15:41:46 -0500
parents ec28f8b66e62
children f3e94aa6e182
files mercurial/parsers.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/parsers.c	Fri Jan 23 15:33:27 2015 -0500
+++ b/mercurial/parsers.c	Fri Jan 23 15:41:46 2015 -0500
@@ -1793,9 +1793,11 @@
 		if (!PyInt_Check(obj)) {
 			PyErr_SetString(PyExc_TypeError,
 					"arguments must all be ints");
+			Py_DECREF(obj);
 			goto bail;
 		}
 		val = PyInt_AsLong(obj);
+		Py_DECREF(obj);
 		if (val == -1) {
 			ret = PyList_New(0);
 			goto done;