diff --git a/dnscrypt-proxy/proxy.go b/dnscrypt-proxy/proxy.go index 1022b13d..b1f448e9 100644 --- a/dnscrypt-proxy/proxy.go +++ b/dnscrypt-proxy/proxy.go @@ -282,6 +282,9 @@ func (proxy *Proxy) exchangeWithTCPServer(serverInfo *ServerInfo, sharedKey *[32 } else { pc, err = (*proxyDialer).Dial("tcp", serverInfo.TCPAddr.String()) } + if err != nil { + return nil, err + } pc.SetDeadline(time.Now().Add(serverInfo.Timeout)) encryptedQuery, err = PrefixWithSize(encryptedQuery) if err != nil {