From 82a3e7d24e3cd51f15df593590986b7c5d0834aa Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 14 Mar 2011 19:35:01 +0000 Subject: poll: fix over-allocation for poll(2) Oops, fortunately we allocated too much and not too little. --- ext/kgio/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/kgio/poll.c b/ext/kgio/poll.c index 0a4cf5a..502f660 100644 --- a/ext/kgio/poll.c +++ b/ext/kgio/poll.c @@ -62,7 +62,7 @@ static int io_to_pollfd_i(VALUE key, VALUE value, VALUE args) static void hash2pollfds(struct poll_args *a) { - a->fds = xmalloc(sizeof(struct poll_args) * RHASH_SIZE(a->ios)); + a->fds = xmalloc(sizeof(struct pollfd) * RHASH_SIZE(a->ios)); a->fd_to_io = st_init_numtable(); rb_hash_foreach(a->ios, io_to_pollfd_i, (VALUE)a); } -- cgit v1.2.3-24-ge0c7