# HG changeset patch # User Augie Fackler # Date 2017-03-10 21:53:00 # Node ID fffd1abb13377cebb1de20661c5995e029724942 # Parent f819aa9dbbf947d32905076f9e461ef695906cad parsers: avoid leak of nonnset and otherpset Py_BuildValue increments the refcount, rather than stealing the reference, which I missed in code review. diff --git a/mercurial/parsers.c b/mercurial/parsers.c --- a/mercurial/parsers.c +++ b/mercurial/parsers.c @@ -604,6 +604,8 @@ static PyObject *nonnormalotherparentent result = Py_BuildValue("(OO)", nonnset, otherpset); if (result == NULL) goto bail; + Py_DECREF(nonnset); + Py_DECREF(otherpset); return result; bail: Py_XDECREF(nonnset);