diff options
author | Xiang Zhang <angwerzx@126.com> | 2017-04-17 00:54:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-17 00:54:21 +0800 |
commit | 8e1ddbd592c3aaf02a58789771f891c0101c6e05 (patch) | |
tree | 38ec8af11170276a355811e10d3dbca65228570a /Objects | |
parent | 55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 (diff) | |
download | cpython-git-8e1ddbd592c3aaf02a58789771f891c0101c6e05.tar.gz |
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 89fe82c7c3..9eb725f062 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; |