Skip to content

Commit

Permalink
fix: defer close after error check
Browse files Browse the repository at this point in the history
Signed-off-by: lucasew <lucas59356@gmail.com>
  • Loading branch information
lucasew committed Oct 18, 2024
1 parent c9914ef commit 282e997
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ func (tps *TailscaleProxyServer) handleError(err error) bool {

func (tps *TailscaleProxyServer) Run() {
ln, err := tps.GetListener()
defer ln.Close()
if tps.handleError(err) {
return
}
defer ln.Close()
server := NewTailscaleTCPProxyServer(tps)
if tps.options.EnableHTTP {
server, err = NewTailscaleHTTPProxyServer(tps)
Expand Down

0 comments on commit 282e997

Please sign in to comment.