mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
net: fix leaking sockets in listen_tcp if an error occurs
This commit is contained in:
@@ -120,6 +120,7 @@ _listen_tcp :: proc(interface_endpoint: Endpoint, backlog := 1000) -> (skt: TCP_
|
||||
family := family_from_endpoint(interface_endpoint)
|
||||
sock := create_socket(family, .TCP) or_return
|
||||
skt = sock.(TCP_Socket)
|
||||
defer if err != nil { close(skt) }
|
||||
|
||||
// NOTE(tetra): This is so that if we crash while the socket is open, we can
|
||||
// bypass the cooldown period, and allow the next run of the program to
|
||||
|
||||
Reference in New Issue
Block a user