Commit 04e8bcb4 authored by Benjamin Peterson's avatar Benjamin Peterson

add missing decrefs

parent 44459deb
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment