Skip to content

Commit 62a5c32

Browse files
committed
Closes #15395: memory leaks in selectmodule.c
1 parent ef86d12 commit 62a5c32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/selectmodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
101101

102102
/* any intervening fileno() calls could decr this refcnt */
103103
if (!(o = PySequence_Fast_GET_ITEM(fast_seq, i)))
104-
return -1;
104+
goto finally;
105105

106106
Py_INCREF(o);
107107
v = PyObject_AsFileDescriptor( o );
@@ -421,6 +421,7 @@ poll_modify(pollObject *self, PyObject *args)
421421
if (PyDict_GetItem(self->dict, key) == NULL) {
422422
errno = ENOENT;
423423
PyErr_SetFromErrno(PyExc_IOError);
424+
Py_DECREF(key);
424425
return NULL;
425426
}
426427
value = PyLong_FromLong(events);

0 commit comments

Comments
 (0)