fix(Core/Pet): Fix possible crash when using dangling pointer as pets spell target and fix possible memory leak. (#21420)

This commit is contained in:
Anton Popovichenko
2025-02-12 21:34:30 +01:00
committed by GitHub
parent 47c524581b
commit fe2627bc91
3 changed files with 13 additions and 8 deletions

View File

@@ -441,7 +441,10 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
bool haspositiveeffect = false;
if (!unit_target)
{
delete spell;
return;
}
// search positive effects for spell
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)