summaryrefslogtreecommitdiffstats
path: root/Python/getargs.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-05-08 01:20:25 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-05-08 01:20:25 (GMT)
commitbcd2c08e11e6739d975345ac832f1722f8752289 (patch)
tree0c0d9d4aa8c33f53760a902764552e9ba0c684d8 /Python/getargs.c
parentec924c995c95198e4391f426a6581e5ccedc1bc6 (diff)
downloadcpython-bcd2c08e11e6739d975345ac832f1722f8752289.zip
cpython-bcd2c08e11e6739d975345ac832f1722f8752289.tar.gz
cpython-bcd2c08e11e6739d975345ac832f1722f8752289.tar.bz2
Fixed a memory leak introduced in r62462
Diffstat (limited to 'Python/getargs.c')
-rw-r--r--Python/getargs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 6a50ef6..2bbafdb 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<n>", 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<n>", arg, msgbuf, bufsize);
*p = ival;