修复内存越界问题RemoveRequest

This commit is contained in:
aozhiwei 2020-05-06 10:15:34 +08:00
parent 3a30aed243
commit fe5b4a67ec

View File

@ -45,7 +45,6 @@ void MasterSvrMgr::_SS_MS_ResponseTargetServer(f8::MsgHdr& hdr, const ss::SS_MS_
{
f8::MsgHdr* context_hdr = GetHdrByContextId(msg.context_id());
if (context_hdr) {
bool auto_free = true;
int socket_handle = context_hdr->socket_handle;
if (msg.error_code() == 0) {
TargetConn* conn = TargetConnMgr::Instance()->RecreateTargetConn(
@ -54,11 +53,12 @@ void MasterSvrMgr::_SS_MS_ResponseTargetServer(f8::MsgHdr& hdr, const ss::SS_MS_
);
assert(conn);
if (conn) {
auto_free = false;
RemoveRequest(socket_handle, msg.context_id(), false);
conn->ForwardClientMsgEx(context_hdr);
return;
}
}
RemoveRequest(socket_handle, msg.context_id(), auto_free);
RemoveRequest(socket_handle, msg.context_id(), true);
}
}