derp/derp_server: fixed unbalanced {register,unregister}Client() calls.

Signed-off-by: Dmitry Adamushko <da@stablebits.net>
pull/269/head
Dmitry Adamushko 5 years ago committed by Brad Fitzpatrick
parent e19287f60f
commit 44434fdc82

@ -255,11 +255,12 @@ func (s *Server) accept(nc Conn, brw *bufio.ReadWriter, remoteAddr string, connN
}
s.registerClient(c)
defer s.unregisterClient(c)
err = s.sendServerInfo(bw, clientKey)
if err != nil {
return fmt.Errorf("send server info: %v", err)
}
defer s.unregisterClient(c)
return c.run(ctx)
}

Loading…
Cancel
Save