diff options
author | pommicket <pommicket@gmail.com> | 2023-09-10 13:40:05 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-09-10 13:40:05 -0400 |
commit | 6586f9e66d87017984f57b3b4579c78897ba66f2 (patch) | |
tree | f84ab9a9b4a6449e123cfed0a3e9245750a19fd6 /os-posix.c | |
parent | 5e22cc67e92a87a0448dea70c89a4472b961fa14 (diff) |
LSP over TCP on windows
Diffstat (limited to 'os-posix.c')
-rw-r--r-- | os-posix.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -458,6 +458,8 @@ Socket *socket_connect_tcp(const char *address, u16 port) { if (connect(fd, &addr, sizeof addr) < 0) { strbuf_printf(s->error, "couldn't connect to %s:%u (%s)", address, port, strerror(errno)); + close(fd); + return s; } set_nonblocking(fd); @@ -492,5 +494,6 @@ void socket_close(Socket **psocket) { if (!s) return; if (s->fd > 0) close(s->fd); + free(s); *psocket = NULL; } |