Skip to content

Commit

Permalink
nit: defer after error check (cloudflare#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
lspgn authored Oct 8, 2022
1 parent 05a03e2 commit 7801c6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ func UDPStoppableRoutine(stopCh <-chan struct{}, name string, decodeFunc decoder

if sockReuse {
pconn, err := reuseport.ListenPacket("udp", addrUDP.String())
defer pconn.Close()
if err != nil {
return err
}
defer pconn.Close()
var ok bool
udpconn, ok = pconn.(*net.UDPConn)
if !ok {
Expand Down

0 comments on commit 7801c6a

Please sign in to comment.