hle: kernel: k_port: Use AcceptSession to ensure SessionList state is correct.

- Fixes a use-after-free, work-around until we fixup session/port management.
This commit is contained in:
bunnei 2021-05-20 20:09:55 -07:00
parent b4fc2e52a2
commit e33ffdc555

View File

@ -56,8 +56,8 @@ ResultCode KPort::EnqueueSession(KServerSession* session) {
R_UNLESS(state == State::Normal, ResultPortClosed);
server.GetSessionRequestHandler()->ClientConnected(session);
server.EnqueueSession(session);
server.GetSessionRequestHandler()->ClientConnected(server.AcceptSession());
return RESULT_SUCCESS;
}