fix(trojan): potential memory leaking (#297)

This commit is contained in:
mzz 2021-11-28 23:14:27 +08:00 committed by GitHub
parent ce85f15c4b
commit ca320d3c7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,6 +84,7 @@ func (s *Trojan) Serve(c net.Conn) {
if s.withTLS {
tlsConn := tls.Server(c, s.tlsConfig)
defer tlsConn.Close()
err := tlsConn.Handshake()
if err != nil {
log.F("[trojan] error in tls handshake: %s", err)