mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Resolve coverity #1023086
Correctly destroy AH pointer and return error to user in unlikely event auctioneer is invalid
This commit is contained in:
@@ -265,6 +265,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
|
||||
if (!auctioneerData)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "Data for auctioneer not found (%s)", auctioneer.ToString().c_str());
|
||||
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR);
|
||||
delete AH;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -272,6 +274,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
|
||||
if (!auctioneerInfo)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "Non existing auctioneer (%s)", auctioneer.ToString().c_str());
|
||||
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR);
|
||||
delete AH;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user