[Python-checkins] r79729 - python/branches/py3k/Modules/_struct.c

benjamin.peterson python-checkins at python.org
Sun Apr 4 01:56:49 CEST 2010


Author: benjamin.peterson
Date: Sun Apr  4 01:56:48 2010
New Revision: 79729

Log:
add missing decrefs

Modified:
   python/branches/py3k/Modules/_struct.c

Modified: python/branches/py3k/Modules/_struct.c
==============================================================================
--- python/branches/py3k/Modules/_struct.c	(original)
+++ python/branches/py3k/Modules/_struct.c	Sun Apr  4 01:56:48 2010
@@ -158,6 +158,7 @@
 		return -1;
 	assert(PyLong_Check(v));
 	x = PyLong_AsUnsignedLong(v);
+        Py_DECREF(v);
 	if (x == (unsigned long)-1 && PyErr_Occurred()) {
 		if (PyErr_ExceptionMatches(PyExc_OverflowError))
 			PyErr_SetString(StructError,
@@ -182,6 +183,7 @@
 		return -1;
 	assert(PyLong_Check(v));
 	x = PyLong_AsLongLong(v);
+        Py_DECREF(v);
 	if (x == (PY_LONG_LONG)-1 && PyErr_Occurred()) {
 		if (PyErr_ExceptionMatches(PyExc_OverflowError))
 			PyErr_SetString(StructError,
@@ -204,6 +206,7 @@
 		return -1;
 	assert(PyLong_Check(v));
 	x = PyLong_AsUnsignedLongLong(v);
+        Py_DECREF(v);
 	if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred()) {
 		if (PyErr_ExceptionMatches(PyExc_OverflowError))
 			PyErr_SetString(StructError,


More information about the Python-checkins mailing list