# HG changeset patch # User Augie Fackler # Date 1422044344 18000 # Node ID fefa5f2a1730acac2300e1af756cc913270eb0ca # Parent 164bd5218ddb6381366d5ce849c9cea4ee431e6f parsers: fix leak of err when asciilower hits a unicode decode error This is one of many errors detected in parsers.c by cpychecker[1]. I haven't gone through all of them yet. 1: https://gcc-python-plugin.readthedocs.org/en/latest/index.html diff --git a/mercurial/parsers.c b/mercurial/parsers.c --- a/mercurial/parsers.c +++ b/mercurial/parsers.c @@ -115,6 +115,7 @@ "ascii", str, len, i, (i + 1), "unexpected code byte"); PyErr_SetObject(PyExc_UnicodeDecodeError, err); + Py_XDECREF(err); goto quit; } newstr[i] = lowertable[(unsigned char)c];