if ((err = sk_addr_error(addr)) != NULL)
if ((err = sk_addr_error(addr)) != NULL) { sk_addr_free(addr);
static const char *connect_to_host(Ssh ssh, char *host, int port,				   char **realhost, int nodelay){    static const struct plug_function_table fn_table = {	ssh_closing,	ssh_receive,	ssh_sent,	NULL    };    SockAddr addr;    const char *err;    ssh->savedhost = snewn(1 + strlen(host), char);    if (!ssh->savedhost)	fatalbox("Out of memory");    strcpy(ssh->savedhost, host);    if (port < 0)	port = 22;		       /* default ssh port */    ssh->savedport = port;    /*     * Try to find host.     */    logeventf(ssh, "Looking up host \"%s\"", host);    addr = name_lookup(host, port, realhost, &ssh->cfg);    if ((err = sk_addr_error(addr)) != NULL)	return err;    /*     * Open socket.     */    {	char addrbuf[100];	sk_getaddr(addr, addrbuf, 100);	logeventf(ssh, "Connecting to %s port %d", addrbuf, port);    }    ssh->fn = &fn_table;    ssh->s = new_connection(addr, *realhost, port,			    0, 1, nodelay, (Plug) ssh, &ssh->cfg);    if ((err = sk_socket_error(ssh->s)) != NULL) {	ssh->s = NULL;	return err;    }    return NULL;}