summaryrefslogtreecommitdiffstats
path: root/Modules/selectmodule.c
diff options
context:
space:
mode:
authorJesus Cea <jcea@jcea.es>2012-07-19 19:32:07 (GMT)
committerJesus Cea <jcea@jcea.es>2012-07-19 19:32:07 (GMT)
commit024abca053dd18b474b41eba2331d35b24c3bae3 (patch)
treee1b08ab146f3698b5669260b09d64c52d14d850a /Modules/selectmodule.c
parent3cd346ae3378fa6de523c037e8b57651d39a79bd (diff)
parent62a5c3216d2bc09adedccaaf2ad8fa79acd6799c (diff)
downloadcpython-024abca053dd18b474b41eba2331d35b24c3bae3.zip
cpython-024abca053dd18b474b41eba2331d35b24c3bae3.tar.gz
cpython-024abca053dd18b474b41eba2331d35b24c3bae3.tar.bz2
MERGE: Closes #15395: memory leaks in selectmodule.c
Diffstat (limited to 'Modules/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 8964b67..5b5eb92 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -107,7 +107,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 );
@@ -438,6 +438,7 @@ poll_modify(pollObject *self, PyObject *args)
if (PyDict_GetItem(self->dict, key) == NULL) {
errno = ENOENT;
PyErr_SetFromErrno(PyExc_OSError);
+ Py_DECREF(key);
return NULL;
}
value = PyLong_FromLong(events);