Skip to content

Commit 8e1ddbd

Browse files
authored
fix a refleak in slot_sq_length (#1162)
1 parent 55fe1ae commit 8e1ddbd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Objects/typeobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5931,6 +5931,7 @@ slot_sq_length(PyObject *self)
59315931

59325932
assert(PyLong_Check(res));
59335933
if (Py_SIZE(res) < 0) {
5934+
Py_DECREF(res);
59345935
PyErr_SetString(PyExc_ValueError,
59355936
"__len__() should return >= 0");
59365937
return -1;

0 commit comments

Comments
 (0)