# HG changeset patch # User Augie Fackler # Date 1422045706 18000 # Node ID 33d6aaf84c9e9820c6c974ac498acbc12187466b # Parent ec28f8b66e622d9cbea7c7c2b1cb01842661af31 parsers.c: fix a memory leak in index_commonancestorsheads Spotted with cpychecker. diff -r ec28f8b66e62 -r 33d6aaf84c9e mercurial/parsers.c --- 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;