[Python-checkins] r69059 - in python/branches/py3k-issue1717: Objects/rangeobject.c PC/winreg.c

mark.dickinson python-checkins at python.org
Wed Jan 28 20:11:04 CET 2009


Author: mark.dickinson
Date: Wed Jan 28 20:11:04 2009
New Revision: 69059
Log:
Fix refleak in range_length_obj.
Set tp_reserved to 0 in PyHKEY_Type.
Modified:
 python/branches/py3k-issue1717/Objects/rangeobject.c
 python/branches/py3k-issue1717/PC/winreg.c
Modified: python/branches/py3k-issue1717/Objects/rangeobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/rangeobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/rangeobject.c	Wed Jan 28 20:11:04 2009
@@ -134,10 +134,11 @@
 PyObject *zero = PyLong_FromLong(0);
 if (zero == NULL)
 return NULL;
- if ((cmp_result = PyObject_RichCompareBool(r->step, zero, Py_GT)) == -1) {
- Py_DECREF(zero);
+ cmp_result = PyObject_RichCompareBool(r->step, zero, Py_GT);
+ Py_DECREF(zero);
+ if (cmp_result == -1)
 return NULL;
- }
+
 if (cmp_result == 1) {
 lo = r->start;
 hi = r->stop;
Modified: python/branches/py3k-issue1717/PC/winreg.c
==============================================================================
--- python/branches/py3k-issue1717/PC/winreg.c	(original)
+++ python/branches/py3k-issue1717/PC/winreg.c	Wed Jan 28 20:11:04 2009
@@ -485,7 +485,7 @@
 	0,				/* tp_print */
 	0,				/* tp_getattr */
 	0,				/* tp_setattr */
-	PyHKEY_compareFunc,		/* tp_reserved */
+	0,				/* tp_reserved */
 	0,				/* tp_repr */
 	&PyHKEY_NumberMethods,		/* tp_as_number */
 	0,				/* tp_as_sequence */


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /