$OpenBSD: patch-Modules_selectmodule_c,v 1.1 2008/08/06 03:23:31 djm Exp $ --- Modules/selectmodule.c.orig Mon Jul 10 11:18:57 2006 +++ Modules/selectmodule.c Tue Aug 5 18:18:52 2008 @@ -349,10 +349,12 @@ update_ufd_array(pollObject *self) { Py_ssize_t i, pos; PyObject *key, *value; + struct pollfd *old_ufds = self->ufds; self->ufd_len = PyDict_Size(self->dict); - PyMem_Resize(self->ufds, struct pollfd, self->ufd_len); + PyMem_RESIZE(self->ufds, struct pollfd, self->ufd_len); if (self->ufds == NULL) { + self->ufds = old_ufds; PyErr_NoMemory(); return 0; }