mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
(chibi net): make-listener-socket: close the socket on error
A socket was leaked in the case where setting socket-opt/reuseaddr failed. (The socket was closed in the cases where bind or listen failed.)
This commit is contained in:
parent
144581b834
commit
a28da66990
1 changed files with 1 additions and 0 deletions
|
@ -90,6 +90,7 @@
|
|||
((not sock)
|
||||
(error "couldn't create socket for: " addrinfo))
|
||||
((not (set-socket-option! sock level/socket socket-opt/reuseaddr 1))
|
||||
(close-file-descriptor sock)
|
||||
(error "couldn't set the socket to be reusable" addrinfo))
|
||||
((not (bind sock
|
||||
(address-info-address addrinfo)
|
||||
|
|
Loading…
Add table
Reference in a new issue