ソースを参照

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 10 年 前
コミット
13b0908ee0
1 ファイル変更1 行追加0 行削除
  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