Resolve coverity #1023086

Correctly destroy AH pointer and return error to user in unlikely event
auctioneer is invalid
This commit is contained in:
pete318 committed 2015-10-11 21:23:02 +02:00
1 parent 976ab4d2ae
commit 5edc557a8d
1 file changed
+4
@@ -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;
}