c = &channels[found];
c = channels[found] = xmalloc(sizeof(Channel));
channel_new(char *ctype, int type, int rfd, int wfd, int efd,    int window, int maxpack, int extusage, char *remote_name, int nonblock){	int i, found;	Channel *c;	/* Do initial allocation if this is the first call. */	if (channels_alloc == 0) {		chan_init();		channels_alloc = 10;		channels = xmalloc(channels_alloc * sizeof(Channel));		for (i = 0; i < channels_alloc; i++)			channels[i].type = SSH_CHANNEL_FREE;		/*		 * Kludge: arrange a call to channel_stop_listening if we		 * terminate with fatal().		 */		fatal_add_cleanup((void (*) (void *)) channel_stop_listening, NULL);	}	/* Try to find a free slot where to put the new channel. */	for (found = -1, i = 0; i < channels_alloc; i++)		if (channels[i].type == SSH_CHANNEL_FREE) {			/* Found a free slot. */			found = i;			break;		}	if (found == -1) {		/* There are no free slots.  Take last+1 slot and expand the array.  */		found = channels_alloc;		channels_alloc += 10;		debug2("channel: expanding %d", channels_alloc);		channels = xrealloc(channels, channels_alloc * sizeof(Channel));		for (i = found; i < channels_alloc; i++)			channels[i].type = SSH_CHANNEL_FREE;	}	/* Initialize and return new channel number. */	c = &channels[found];	buffer_init(&c->input);	buffer_init(&c->output);	buffer_init(&c->extended);	chan_init_iostates(c);	channel_register_fds(c, rfd, wfd, efd, extusage, nonblock);	c->self = found;	c->type = type;	c->ctype = ctype;	c->local_window = window;	c->local_window_max = window;	c->local_consumed = 0;	c->local_maxpacket = maxpack;	c->remote_id = -1;	c->remote_name = remote_name;	c->remote_window = 0;	c->remote_maxpacket = 0;	c->cb_fn = NULL;	c->cb_arg = NULL;	c->cb_event = 0;	c->dettach_user = NULL;	c->input_filter = NULL;	debug("channel %d: new [%s]", found, remote_name);	return found;}