From 0a0b69d93d00b4f15ea20e96a0bfda2f6ca6fdea Mon Sep 17 00:00:00 2001 From: lifenjoiner Date: Tue, 14 Jun 2022 20:25:52 +0800 Subject: [PATCH] RUnlock for early exit (#2127) --- dnscrypt-proxy/serversInfo.go | 1 + 1 file changed, 1 insertion(+) diff --git a/dnscrypt-proxy/serversInfo.go b/dnscrypt-proxy/serversInfo.go index 9d1577c8..93adc964 100644 --- a/dnscrypt-proxy/serversInfo.go +++ b/dnscrypt-proxy/serversInfo.go @@ -338,6 +338,7 @@ func findFarthestRoute(proxy *Proxy, name string, relayStamps []stamps.ServerSta } } if serverIdx < 0 { + proxy.serversInfo.RUnlock() return nil } server := proxy.serversInfo.registeredServers[serverIdx]