Skip to content

Commit

Permalink
Fix heap-use-after-free issue with groups
Browse files Browse the repository at this point in the history
==2317==ERROR: AddressSanitizer: heap-use-after-free on address 0x6170000633c0 at pc 0x55ed1d8e8d8b bp 0x7ffda4bef580 sp 0x7ffda4bef578
WRITE of size 8 at 0x6170000633c0 thread T0
    #0 0x55ed1d8e8d8a in Group::SetLeader(Mob*) ../zone/groups.h:80
    #1 0x55ed1d8e8d8a in Group::DisbandGroup(bool) ../zone/groups.cpp:1016

ASan didn't like this
  • Loading branch information
mackal committed Mar 1, 2021
1 parent 66f8941 commit 6d47351
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions zone/groups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1006,15 +1006,14 @@ void Group::DisbandGroup(bool joinraid) {
database.ClearGroup(GetID());
}

entity_list.RemoveGroup(GetID());

if(Leader && (Leader->IsLFP()))
{
Leader->UpdateLFP();
}

SetLeader(nullptr);
safe_delete(outapp);
entity_list.RemoveGroup(GetID());
}

void Group::GetMemberList(std::list<Mob*>& member_list, bool clear_list)
Expand Down

0 comments on commit 6d47351

Please sign in to comment.