mirror of
https://github.com/golang/go
synced 2024-11-22 07:14:40 -07:00
net/ipsock.go: fix error checking bug
Check oserr, not err for non-nil (err is never changed) R=golang-dev, r CC=golang-dev https://golang.org/cl/1965042
This commit is contained in:
parent
e5518feaf8
commit
d125faeed0
@ -68,12 +68,12 @@ func internetSocket(net string, laddr, raddr sockaddr, socktype, proto int, mode
|
||||
|
||||
var la, ra syscall.Sockaddr
|
||||
if laddr != nil {
|
||||
if la, oserr = laddr.sockaddr(family); err != nil {
|
||||
if la, oserr = laddr.sockaddr(family); oserr != nil {
|
||||
goto Error
|
||||
}
|
||||
}
|
||||
if raddr != nil {
|
||||
if ra, oserr = raddr.sockaddr(family); err != nil {
|
||||
if ra, oserr = raddr.sockaddr(family); oserr != nil {
|
||||
goto Error
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user