mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-13 01:21:38 -07:00
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