# HG changeset patch # User Yuya Nishihara # Date 2015-08-14 03:36:41 # Node ID 9e7d805925c87cfa0ca30819e8273ac37fd77a62 # Parent a3d5da8b641ee0a6336d708d839d3dad809fc86f reachableroots: fix memleak of integer objects at includepath loop In the first visit loop, val is decref-ed correctly after PySet_Add(). Let's do the same for the includepath loop. diff --git a/mercurial/parsers.c b/mercurial/parsers.c --- a/mercurial/parsers.c +++ b/mercurial/parsers.c @@ -1232,6 +1232,7 @@ static PyObject *reachableroots(indexObj if (val == NULL) goto bail; PySet_Add(reachable, val); + Py_DECREF(val); } Py_DECREF(p); }