Skip to content

Commit

Permalink
Fix potential memory leak when forming battleground groups.
Browse files Browse the repository at this point in the history
Thanks to Chero.
  • Loading branch information
ratkosrb committed Nov 13, 2024
1 parent af1ac43 commit 1a41410
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/game/Battlegrounds/BattleGround.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,8 @@ void BattleGround::AddOrSetPlayerToCorrectBgGroup(Player* pPlayer, ObjectGuid pl
{
group = new Group;
SetBgRaid(team, group);

This comment has been minimized.

Copy link
@0blu

0blu Nov 13, 2024

Collaborator

use after free in SetBgRaid(team, group);

group->Create(playerGuid, pPlayer->GetName());
if (!group->Create(playerGuid, pPlayer->GetName()))
delete group;
}
}

Expand Down

0 comments on commit 1a41410

Please sign in to comment.