# HG changeset patch # User Siddharth Agarwal # Date 2015-04-01 20:58:51 # Node ID a62e957413f7d24d7d0cd14561033337d09e1dca # Parent e97a00bf18ae4156ba1590ae08bf204db29ca132 parsers._asciilower: use an explicit return object No functional change, but this will make upcoming patches cleaner. diff --git a/mercurial/parsers.c b/mercurial/parsers.c --- a/mercurial/parsers.c +++ b/mercurial/parsers.c @@ -98,6 +98,7 @@ static inline PyObject *_asciilower(PyOb char *str, *newstr; Py_ssize_t i, len; PyObject *newobj = NULL; + PyObject *ret = NULL; str = PyBytes_AS_STRING(str_obj); len = PyBytes_GET_SIZE(str_obj); @@ -121,10 +122,11 @@ static inline PyObject *_asciilower(PyOb newstr[i] = lowertable[(unsigned char)c]; } - return newobj; + ret = newobj; + Py_INCREF(ret); quit: Py_XDECREF(newobj); - return NULL; + return ret; } static PyObject *asciilower(PyObject *self, PyObject *args)