diff --git a/mercurial/cext/bdiff.c b/mercurial/cext/bdiff.c --- a/mercurial/cext/bdiff.c +++ b/mercurial/cext/bdiff.c @@ -256,13 +256,12 @@ static int hunk_consumer(int64_t a1, int { PyObject *rl = (PyObject *)priv; PyObject *m = Py_BuildValue("LLLL", a1, a2, b1, b2); + int r; if (!m) return -1; - if (PyList_Append(rl, m) != 0) { - Py_DECREF(m); - return -1; - } - return 0; + r = PyList_Append(rl, m); + Py_DECREF(m); + return r; } static PyObject *xdiffblocks(PyObject *self, PyObject *args)