mirror of
https://github.com/odin-lang/Odin.git
synced 2026-03-03 23:28:20 +00:00
Merge pull request #2929 from divanburger/dial_bug_fix
Fix use of unitialized socket in socket_linux.odin#_dial_tcp_from_endpoint
This commit is contained in:
@@ -143,7 +143,7 @@ _dial_tcp_from_endpoint :: proc(endpoint: Endpoint, options := default_tcp_optio
|
||||
reuse_addr: b32 = true
|
||||
_ = linux.setsockopt(os_sock, linux.SOL_SOCKET, linux.Socket_Option.REUSEADDR, &reuse_addr)
|
||||
addr := _unwrap_os_addr(endpoint)
|
||||
errno = linux.connect(linux.Fd(tcp_sock), &addr)
|
||||
errno = linux.connect(linux.Fd(os_sock), &addr)
|
||||
if errno != .NONE {
|
||||
return cast(TCP_Socket) os_sock, Dial_Error(errno)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user