Skip to content

Commit

Permalink
Pet: fix heap-use-after-free due to trying to unsummon an already uns…
Browse files Browse the repository at this point in the history
…ummoned pet
  • Loading branch information
Karth-Xyver committed Oct 31, 2023
1 parent d28db40 commit 0388d21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/game/Entities/Pet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,10 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid)

void Pet::Unsummon(PetSaveMode mode, Unit* owner /*= nullptr*/)
{
// do not attempt to unsummon pet if already unsummoned
if (m_removed)
return;

if (!owner)
owner = GetOwner();

Expand Down

0 comments on commit 0388d21

Please sign in to comment.