1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-23 08:08:47 -05:00

Fix srp.cpp:815 leak

Thanks @Zeno-
This commit is contained in:
est31 2015-07-27 07:44:48 +02:00
parent c30a2d6854
commit f336d3ffb6
2 changed files with 1 additions and 4 deletions

View File

@ -974,6 +974,7 @@ void Client::deleteAuthData()
case AUTH_MECHANISM_NONE: case AUTH_MECHANISM_NONE:
break; 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); NetworkPacket resp_pkt(TOSERVER_SRP_BYTES_A, 0);
resp_pkt << std::string(bytes_A, len_A) << based_on; resp_pkt << std::string(bytes_A, len_A) << based_on;
free(bytes_A);
Send(&resp_pkt); Send(&resp_pkt);
break; break;
} }

View File

@ -100,7 +100,6 @@ void Client::handleCommand_Hello(NetworkPacket* pkt)
void Client::handleCommand_AuthAccept(NetworkPacket* pkt) void Client::handleCommand_AuthAccept(NetworkPacket* pkt)
{ {
m_chosen_auth_mech = AUTH_MECHANISM_NONE;
deleteAuthData(); deleteAuthData();
v3f playerpos; v3f playerpos;
@ -126,7 +125,6 @@ void Client::handleCommand_AuthAccept(NetworkPacket* pkt)
} }
void Client::handleCommand_AcceptSudoMode(NetworkPacket* pkt) void Client::handleCommand_AcceptSudoMode(NetworkPacket* pkt)
{ {
m_chosen_auth_mech = AUTH_MECHANISM_NONE;
deleteAuthData(); deleteAuthData();
m_password = m_new_password; 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."); m_chat_queue.push(L"Password change denied. Password NOT changed.");
// reset everything and be sad // reset everything and be sad
deleteAuthData(); deleteAuthData();
m_chosen_auth_mech = AUTH_MECHANISM_NONE;
} }
void Client::handleCommand_InitLegacy(NetworkPacket* pkt) void Client::handleCommand_InitLegacy(NetworkPacket* pkt)
{ {