mirror of
https://github.com/golang/go
synced 2024-11-02 08:01:26 +00: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
1 changed files with 2 additions and 2 deletions
|
@ -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 a new issue