# HG changeset patch # User Siddharth Agarwal # Date 1427921931 25200 # Node ID a62e957413f7d24d7d0cd14561033337d09e1dca # Parent e97a00bf18ae4156ba1590ae08bf204db29ca132 parsers._asciilower: use an explicit return object No functional change, but this will make upcoming patches cleaner. diff -r e97a00bf18ae -r a62e957413f7 mercurial/parsers.c --- a/mercurial/parsers.c Tue Mar 31 10:25:29 2015 -0700 +++ b/mercurial/parsers.c Wed Apr 01 13:58:51 2015 -0700 @@ -98,6 +98,7 @@ 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 @@ 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)