diff --git a/server/wsproxy/mastermgr.cc b/server/wsproxy/mastermgr.cc index 9800c4e..107162c 100644 --- a/server/wsproxy/mastermgr.cc +++ b/server/wsproxy/mastermgr.cc @@ -6,6 +6,7 @@ #include #include +#include #include "mastermgr.h" #include "master.h" @@ -165,10 +166,8 @@ void MasterMgr::RemoveRequest(int socket_handle) auto req = GetRequestBySocket(socket_handle); if (req) { if (req->hdr_copy) { - if (req->hdr_copy->buf) { - free((char*)req->hdr_copy->buf); - } - free(req->hdr_copy); + f8::MsgHdr::Destroy(req->hdr_copy); + req->hdr_copy = nullptr; } pending_context_hash_.erase(req->context_id); pending_socket_hash_.erase(socket_handle);