From b593f39d0d4e9e1f2ba9c43b03408b8a3356a694 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Fri, 7 Feb 2025 21:21:31 -0500 Subject: [PATCH] ensure during RPTK failure we cleanup the connection if a NAK occurs; --- src/fne/network/FNENetwork.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fne/network/FNENetwork.cpp b/src/fne/network/FNENetwork.cpp index c239df4f..5385b893 100644 --- a/src/fne/network/FNENetwork.cpp +++ b/src/fne/network/FNENetwork.cpp @@ -755,12 +755,16 @@ void* FNENetwork::threadedNetworkRx(void* arg) else { LogWarning(LOG_NET, "PEER %u RPTK NAK, login exchange while in an incorrect state, connectionState = %u", peerId, connection->connectionState()); network->writePeerNAK(peerId, TAG_REPEATER_AUTH, NET_CONN_NAK_BAD_CONN_STATE, req->address, req->addrLen); + + delete connection; network->erasePeer(peerId); } } } else { network->writePeerNAK(peerId, TAG_REPEATER_AUTH, NET_CONN_NAK_BAD_CONN_STATE, req->address, req->addrLen); + + network->erasePeer(peerId); LogWarning(LOG_NET, "PEER %u RPTK NAK, having no connection", peerId); } }