[Python-checkins] r76967 - python/trunk/Modules/_testcapimodule.c

mark.dickinson python-checkins at python.org
Mon Dec 21 12:31:55 CET 2009


Author: mark.dickinson
Date: Mon Dec 21 12:31:54 2009
New Revision: 76967

Log:
Fix reference counts for test_long_and_overflow.

Modified:
   python/trunk/Modules/_testcapimodule.c

Modified: python/trunk/Modules/_testcapimodule.c
==============================================================================
--- python/trunk/Modules/_testcapimodule.c	(original)
+++ python/trunk/Modules/_testcapimodule.c	Mon Dec 21 12:31:54 2009
@@ -388,6 +388,8 @@
 		return raiseTestError("test_long_and_overflow",
 			"overflow was not set to 0");
 
+	Py_DECREF(num);
+
 	/* a number smaller than LONG_MIN even on 64-bit platforms */
 	num = PyLong_FromString("-FFFFFFFFFFFFFFFFFFFFFFFF", NULL, 16);
 	if (num == NULL)
@@ -406,6 +408,8 @@
 		return raiseTestError("test_long_and_overflow",
 			"overflow was not set to 0");
 
+	Py_DECREF(num);
+
 	num = PyLong_FromString("FF", NULL, 16);
 	if (num == NULL)
 		return NULL;
@@ -423,6 +427,8 @@
 		return raiseTestError("test_long_and_overflow",
 			"overflow was set incorrectly");
 
+	Py_DECREF(num);
+
 	Py_INCREF(Py_None);
 	return Py_None;
 }


More information about the Python-checkins mailing list