summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus Cea <jcea@jcea.es>2012-07-19 19:31:26 (GMT)
committerJesus Cea <jcea@jcea.es>2012-07-19 19:31:26 (GMT)
commit62a5c3216d2bc09adedccaaf2ad8fa79acd6799c (patch)
tree6e422866b147ee8d6abd13a966c6e93a126379a0
parentef86d12979b878bd5f3a1ffc73f5373c722eb664 (diff)
downloadcpython-62a5c3216d2bc09adedccaaf2ad8fa79acd6799c.zip
cpython-62a5c3216d2bc09adedccaaf2ad8fa79acd6799c.tar.gz
cpython-62a5c3216d2bc09adedccaaf2ad8fa79acd6799c.tar.bz2
Closes #15395: memory leaks in selectmodule.c
-rw-r--r--Modules/selectmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 2452a65..98b3108 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -101,7 +101,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
/* any intervening fileno() calls could decr this refcnt */
if (!(o = PySequence_Fast_GET_ITEM(fast_seq, i)))
- return -1;
+ goto finally;
Py_INCREF(o);
v = PyObject_AsFileDescriptor( o );
@@ -421,6 +421,7 @@ poll_modify(pollObject *self, PyObject *args)
if (PyDict_GetItem(self->dict, key) == NULL) {
errno = ENOENT;
PyErr_SetFromErrno(PyExc_IOError);
+ Py_DECREF(key);
return NULL;
}
value = PyLong_FromLong(events);