From: Christian Heimes Date: Thu, 8 May 2008 01:20:25 +0000 (+0000) Subject: Fixed a memory leak introduced in r62462 X-Git-Tag: v3.0a5~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bcd2c08e11e6739d975345ac832f1722f8752289;p=thirdparty%2FPython%2Fcpython.git Fixed a memory leak introduced in r62462 --- diff --git a/Python/getargs.c b/Python/getargs.c index 6a50ef672ce1..2bbafdb9db55 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -670,8 +670,10 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, if (float_argument_error(arg)) return converterr("integer", arg, msgbuf, bufsize); iobj = PyNumber_Index(arg); - if (iobj != NULL) + if (iobj != NULL) { ival = PyLong_AsSsize_t(iobj); + Py_DECREF(iobj); + } if (ival == -1 && PyErr_Occurred()) return converterr("integer", arg, msgbuf, bufsize); *p = ival;