Explorar o código

websocket: fix socket leak in the case of negotiation failure

Change-Id: Ie5712a49f0c909538f4c36311b591e930a77efb5
Reviewed-on: https://go-review.googlesource.com/5410
Reviewed-by: Andrew Gerrand <adg@golang.org>
Mikio Hara %!s(int64=10) %!d(string=hai) anos
pai
achega
13b0908ee0
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      websocket/client.go

+ 1 - 0
websocket/client.go

@@ -103,6 +103,7 @@ func DialConfig(config *Config) (ws *Conn, err error) {
 
 	ws, err = NewClient(config, client)
 	if err != nil {
+		client.Close()
 		goto Error
 	}
 	return