BBS:      TELESC.NET.BR
Assunto:  src/sbbs3/js_socket.cpp
De:       Rob Swindell (on Debian Linux)
Data:     Wed, 6 May 2026 22:36:57 -0700
-----------------------------------------------------------
https://gitlab.synchro.net/main/sbbs/-/commit/99b45532cd579daceacd8f72
Modified Files:
	src/sbbs3/js_socket.cpp
Log Message:
js_socket: close socket on fail-path in connected_socket_constructor (CID 530501)

The 'fail:' label freed p without closing p->sock, leaking the socket
handle when set_socket_options() failed after a successful socket()
call. Initialize p->sock to INVALID_SOCKET right after the memset
(so the getaddrinfo-failure path doesn't accidentally close fd 0)
and have the fail label closesocket() when the socket is valid.

Co-Authored-By: Claude Opus 4.7 
n
---
  mSynchronetn  hgVertrauen n hHome of Synchronet n gh[vert/cvs/bbs].synchro.net

-----------------------------------------------------------
[Voltar]