]> granicus.if.org Git - python/commitdiff
Fixed a memory leak introduced in r62462
authorChristian Heimes <christian@cheimes.de>
Thu, 8 May 2008 01:20:25 +0000 (01:20 +0000)
committerChristian Heimes <christian@cheimes.de>
Thu, 8 May 2008 01:20:25 +0000 (01:20 +0000)
Python/getargs.c

index 6a50ef672ce1622d841569bdabb1a0cb60e5fe1f..2bbafdb9db55a1aab2db8d71e6d18c07498ce6a8 100644 (file)
@@ -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;