diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/selectmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index a1e3cf0..dfe95484 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -100,7 +100,9 @@ list2set(list, set, fd2obj) SOCKET v; /* any intervening fileno() calls could decr this refcnt */ - o = PyList_GetItem(list, i); + if (!(o = PyList_GetItem(list, i))) + return NULL; + Py_INCREF(o); if (PyInt_Check(o)) { |