Skip to content

Commit e6a55dd

Browse files
authored
bpo-29874: fix INCREF for possible NULL values in select_select() (GH-758)
1 parent 827c783 commit e6a55dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/selectmodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ select_select(PyObject *self, PyObject *args)
289289
else
290290
ret = PyTuple_Pack(3, ifdlist, ofdlist, efdlist);
291291

292-
Py_DECREF(ifdlist);
293-
Py_DECREF(ofdlist);
294-
Py_DECREF(efdlist);
292+
Py_XDECREF(ifdlist);
293+
Py_XDECREF(ofdlist);
294+
Py_XDECREF(efdlist);
295295
}
296296

297297
finally:
@@ -1298,7 +1298,7 @@ kqueue_event_init(kqueue_event_Object *self, PyObject *args, PyObject *kwds)
12981298

12991299
if (PyLong_Check(pfd)
13001300
#if IDENT_TYPE == T_UINT
1301-
&& PyLong_AsUnsignedLong(pfd) <= UINT_MAX
1301+
&& PyLong_AsUnsignedLong(pfd) <= UINT_MAX
13021302
#endif
13031303
) {
13041304
self->e.ident = IDENT_AsType(pfd);

0 commit comments

Comments
 (0)