Merge pull request #822 from Viste/memoty

Core/Misc: Fixed memory leak in trade handler
This commit is contained in:
Francesco Borzì
2018-04-01 10:36:05 +02:00
committed by GitHub

View File

@@ -427,6 +427,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
trader->GetSession()->SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS); trader->GetSession()->SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS);
my_trade->SetAccepted(false); my_trade->SetAccepted(false);
his_trade->SetAccepted(false); his_trade->SetAccepted(false);
delete my_spell;
delete his_spell;
return; return;
} }
else if (!hisCanCompleteTrade) else if (!hisCanCompleteTrade)
@@ -437,6 +439,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
trader->GetSession()->SendNotification(LANG_NOT_FREE_TRADE_SLOTS); trader->GetSession()->SendNotification(LANG_NOT_FREE_TRADE_SLOTS);
my_trade->SetAccepted(false); my_trade->SetAccepted(false);
his_trade->SetAccepted(false); his_trade->SetAccepted(false);
delete my_spell;
delete his_spell;
return; return;
} }