mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/Commands: Fix heap-use-after-free in ".ticket delete" command
Reported by Address Sanitizer
This commit is contained in:
@@ -291,9 +291,6 @@ public:
|
||||
std::string msg = ticket->FormatMessageString(*handler, nullptr, nullptr, nullptr, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", nullptr);
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
|
||||
sTicketMgr->RemoveTicket(ticket->GetId());
|
||||
sTicketMgr->UpdateLastChange();
|
||||
|
||||
if (Player* player = ticket->GetPlayer())
|
||||
{
|
||||
// Force abandon ticket
|
||||
@@ -302,6 +299,9 @@ public:
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
sTicketMgr->RemoveTicket(ticket->GetId());
|
||||
sTicketMgr->UpdateLastChange();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user