diff Python/getargs.c @ 46721:ad7751a95809

Fixed a memory leak introduced in r62462
author Christian Heimes <christian@cheimes.de>
date Thu, 08 May 2008 01:20:25 +0000
parents c0cdacf07f54
children ba23fc157618
line wrap: on
line diff
--- a/Python/getargs.c	Wed May 07 02:48:42 2008 +0000
+++ b/Python/getargs.c	Thu May 08 01:20:25 2008 +0000
@@ -670,8 +670,10 @@
 		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;