switch (channels[i].type) { case SSH_CHANNEL_AUTH_SOCKET: close(channels[i].sock); unlink(channels[i].path); channel_free(i); break; case SSH_CHANNEL_PORT_LISTENER: case SSH_CHANNEL_RPORT_LISTENER: case SSH_CHANNEL_X11_LISTENER: close(channels[i].sock); channel_free(i); break; default: break;
c = channels[i]; if (c != NULL) { switch (c->type) { case SSH_CHANNEL_AUTH_SOCKET: close(c->sock); unlink(c->path); channel_free(c); break; case SSH_CHANNEL_PORT_LISTENER: case SSH_CHANNEL_RPORT_LISTENER: case SSH_CHANNEL_X11_LISTENER: close(c->sock); channel_free(c); break; default: break; }
channel_stop_listening(){	int i;	for (i = 0; i < channels_alloc; i++) {		switch (channels[i].type) {		case SSH_CHANNEL_AUTH_SOCKET:			close(channels[i].sock);			unlink(channels[i].path);			channel_free(i);			break;		case SSH_CHANNEL_PORT_LISTENER:		case SSH_CHANNEL_RPORT_LISTENER:		case SSH_CHANNEL_X11_LISTENER:			close(channels[i].sock);			channel_free(i);			break;		default:			break;		}	}}