mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net: fix panic in TestDialerDualStack
This change ensures that the test does not try to close dual stack listeners which have not yet been opened. Spotted in crash here http://build.golang.org/log/e5843777df400868ce708b7f00c50dc32c2ec478 Change-Id: I79d513e166effb3e018e2b9dfc23751d92fcbe4b Reviewed-on: https://go-review.googlesource.com/10371 Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com> Run-TryBot: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
e5060c7f75
commit
994b2d4645
1 changed files with 1 additions and 1 deletions
|
|
@ -186,7 +186,7 @@ func newDualStackServer(lns []streamListener) (*dualStackServer, error) {
|
|||
for i := range dss.lns {
|
||||
ln, err := Listen(dss.lns[i].network, JoinHostPort(dss.lns[i].address, dss.port))
|
||||
if err != nil {
|
||||
for _, ln := range dss.lns {
|
||||
for _, ln := range dss.lns[:i] {
|
||||
ln.Listener.Close()
|
||||
}
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue