diff options
author | Xiang Zhang <angwerzx@126.com> | 2017-04-16 16:54:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-16 16:54:21 (GMT) |
commit | 8e1ddbd592c3aaf02a58789771f891c0101c6e05 (patch) | |
tree | 38ec8af11170276a355811e10d3dbca65228570a /Objects | |
parent | 55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 (diff) | |
download | cpython-8e1ddbd592c3aaf02a58789771f891c0101c6e05.zip cpython-8e1ddbd592c3aaf02a58789771f891c0101c6e05.tar.gz cpython-8e1ddbd592c3aaf02a58789771f891c0101c6e05.tar.bz2 |
fix a refleak in slot_sq_length (#1162)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 89fe82c..9eb725f 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5931,6 +5931,7 @@ slot_sq_length(PyObject *self) assert(PyLong_Check(res)); if (Py_SIZE(res) < 0) { + Py_DECREF(res); PyErr_SetString(PyExc_ValueError, "__len__() should return >= 0"); return -1; |