mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-05 19:34:12 +00:00
nimsuggest: fix tcp socket leak (#12377) [backport]
A new socket is created for each iteration and leak immediately thanks to the accept() call replacing the created socket with the client socket. This commit fixes that.
This commit is contained in:
@@ -319,8 +319,8 @@ proc replTcp(x: ThreadParams) {.thread.} =
|
||||
server.bindAddr(x.port, x.address)
|
||||
server.listen()
|
||||
var inp = "".TaintedString
|
||||
var stdoutSocket: Socket
|
||||
while true:
|
||||
var stdoutSocket = newSocket()
|
||||
accept(server, stdoutSocket)
|
||||
|
||||
stdoutSocket.readLine(inp)
|
||||
|
||||
Reference in New Issue
Block a user