add missing decrefs

This commit is contained in:
Benjamin Peterson 2010-04-03 23:56:48 +00:00
parent 44459debc6
commit 04e8bcb49a
1 changed files with 3 additions and 0 deletions

View File

@ -158,6 +158,7 @@ get_ulong(PyObject *v, unsigned long *p)
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 @@ get_longlong(PyObject *v, PY_LONG_LONG *p)
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 @@ get_ulonglong(PyObject *v, unsigned PY_LONG_LONG *p)
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,