fix: use after free in TCPInterface (#1879)

lol
This commit is contained in:
David Markowitz
2025-09-18 23:12:34 -07:00
committed by GitHub
parent 6389876c6e
commit 06022e4b19

View File

@@ -211,8 +211,8 @@ SystemAddress TCPInterface::Connect(const char* host, unsigned short remotePort,
int errorCode = RakNet::RakThread::Create(ConnectionAttemptLoop, s); int errorCode = RakNet::RakThread::Create(ConnectionAttemptLoop, s);
if (errorCode!=0) if (errorCode!=0)
{ {
delete s;
failedConnectionAttempts.Push(s->systemAddress); failedConnectionAttempts.Push(s->systemAddress);
delete s;
} }
return UNASSIGNED_SYSTEM_ADDRESS; return UNASSIGNED_SYSTEM_ADDRESS;
} }