From: est31 Date: Mon, 27 Jul 2015 05:44:48 +0000 (+0200) Subject: Fix srp.cpp:815 leak X-Git-Tag: 0.4.13~77 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f336d3ffb657d2fcc72d06c28642c1b418e8dec4;p=oweals%2Fminetest.git Fix srp.cpp:815 leak Thanks @Zeno- --- diff --git a/src/client.cpp b/src/client.cpp index 74072d9d7..63f720f04 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -974,6 +974,7 @@ void Client::deleteAuthData() case AUTH_MECHANISM_NONE: break; } + m_chosen_auth_mech = AUTH_MECHANISM_NONE; } @@ -1060,7 +1061,6 @@ void Client::startAuth(AuthMechanism chosen_auth_mechanism) NetworkPacket resp_pkt(TOSERVER_SRP_BYTES_A, 0); resp_pkt << std::string(bytes_A, len_A) << based_on; - free(bytes_A); Send(&resp_pkt); break; } diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index 2133543d9..86091bc88 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -100,7 +100,6 @@ void Client::handleCommand_Hello(NetworkPacket* pkt) void Client::handleCommand_AuthAccept(NetworkPacket* pkt) { - m_chosen_auth_mech = AUTH_MECHANISM_NONE; deleteAuthData(); v3f playerpos; @@ -126,7 +125,6 @@ void Client::handleCommand_AuthAccept(NetworkPacket* pkt) } void Client::handleCommand_AcceptSudoMode(NetworkPacket* pkt) { - m_chosen_auth_mech = AUTH_MECHANISM_NONE; deleteAuthData(); m_password = m_new_password; @@ -144,7 +142,6 @@ void Client::handleCommand_DenySudoMode(NetworkPacket* pkt) m_chat_queue.push(L"Password change denied. Password NOT changed."); // reset everything and be sad deleteAuthData(); - m_chosen_auth_mech = AUTH_MECHANISM_NONE; } void Client::handleCommand_InitLegacy(NetworkPacket* pkt) {