]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Closes #15395: memory leaks in selectmodule.c
authorJesus Cea <jcea@jcea.es>
Thu, 19 Jul 2012 19:31:26 +0000 (21:31 +0200)
committerJesus Cea <jcea@jcea.es>
Thu, 19 Jul 2012 19:31:26 +0000 (21:31 +0200)
Modules/selectmodule.c

index 2452a651b17366d83e0405841022b240975293c1..98b3108bf3ceb7c3c0eade9b5c79c8d7f29009aa 100644 (file)
@@ -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);