c = &channels[i];
channel_handler(chan_fn *ftab[], fd_set * readset, fd_set * writeset){	static int did_init = 0;	int i;	Channel *c;	if (!did_init) {		channel_handler_init();		did_init = 1;	}	for (i = 0; i < channels_alloc; i++) {		c = &channels[i];		if (c->type == SSH_CHANNEL_FREE)			continue;		if (ftab[c->type] == NULL)			continue;		(*ftab[c->type])(c, readset, writeset);		c = &channels[i]; /* XXX realloc */		if (chan_is_dead(c)) {			/*			 * we have to remove the fd's from the select mask			 * before the channels are free'd and the fd's are			 * closed			 */			if (c->wfd != -1)				FD_CLR(c->wfd, writeset);			if (c->rfd != -1)				FD_CLR(c->rfd, readset);			if (c->efd != -1) {				if (c->extended_usage == CHAN_EXTENDED_READ)					FD_CLR(c->efd, readset);				if (c->extended_usage == CHAN_EXTENDED_WRITE)					FD_CLR(c->efd, writeset);			}			channel_free(c->self);		}	}}