diff --git a/SQCSim-srv/server.cpp b/SQCSim-srv/server.cpp index 0ed0387..f0b79fb 100644 --- a/SQCSim-srv/server.cpp +++ b/SQCSim-srv/server.cpp @@ -159,8 +159,8 @@ int Server::Ready() { } } } - delete buf; - delete strbuf; + delete[] buf; + delete[] strbuf; return 0; } @@ -224,7 +224,7 @@ void Server::Log(std::string str, bool is_error = false, bool is_fatal = false) closesocket(m_sock_udp); if (m_sock_tcp) closesocket(m_sock_tcp); - for (auto& [key, player] : m_players) + for (const auto& [key, player] : m_players) closesocket(player->getSock()); m_players.clear(); #ifdef _WIN32