diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-04-03 23:56:48 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-04-03 23:56:48 (GMT) |
commit | 04e8bcb49a7c3b61bc8e4ef8c0426bbcf9cca8d7 (patch) | |
tree | d2bc45cc6959c3a3e679e5d6eecdfc82796777c9 /Modules/_struct.c | |
parent | 44459debc620106ed156c6ae8bc32ec02e3dec98 (diff) | |
download | cpython-04e8bcb49a7c3b61bc8e4ef8c0426bbcf9cca8d7.zip cpython-04e8bcb49a7c3b61bc8e4ef8c0426bbcf9cca8d7.tar.gz cpython-04e8bcb49a7c3b61bc8e4ef8c0426bbcf9cca8d7.tar.bz2 |
add missing decrefs
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r-- | Modules/_struct.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c index e21487d..d000df2 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -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, |