blob: 85c60356c3ae39260e2c8e6806433f3e43cc6109 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
$NetBSD: patch-bk,v 1.1 2008/08/05 10:45:45 drochner Exp $
--- Modules/selectmodule.c.orig 2006-09-27 21:17:32.000000000 +0200
+++ Modules/selectmodule.c
@@ -342,10 +342,12 @@ update_ufd_array(pollObject *self)
{
int 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;
}
|