Skip to content

Commit

Permalink
Fix srp.cpp:815 leak
Browse files Browse the repository at this point in the history
Thanks @Zeno-
  • Loading branch information
est31 committed Jul 27, 2015
1 parent c30a2d6 commit f336d3f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion src/client.cpp
Expand Up @@ -974,6 +974,7 @@ void Client::deleteAuthData()
case AUTH_MECHANISM_NONE:
break;
}
m_chosen_auth_mech = AUTH_MECHANISM_NONE;
}


Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 0 additions & 3 deletions src/network/clientpackethandler.cpp
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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)
{
Expand Down

0 comments on commit f336d3f

Please sign in to comment.