Core/PetAI: Fix memory leak

Fix memory leak added in e7f0808d46

Valgrind log:
395,712 (390,216 direct, 5,496 indirect) bytes in 229 blocks are definitely lost in loss record 65 of 67
 at operator new(unsigned long) (vg_replace_malloc.c:320)
 by PetAI::UpdateAI(unsigned int) (PetAI.cpp:167)
 by Creature::Update(unsigned int) (Creature.cpp:541)
 by TempSummon::Update(unsigned int) (TemporarySummon.cpp:47)
This commit is contained in:
jackpoz
2014-06-10 22:50:24 +02:00
parent 48f426abc5
commit f19c6f4091

View File

@@ -183,7 +183,11 @@ void PetAI::UpdateAI(uint32 diff)
}
if (spellInfo->HasEffect(SPELL_EFFECT_JUMP_DEST))
{
if (!spellUsed)
delete spell;
continue; // Pets must only jump to target
}
// No enemy, check friendly
if (!spellUsed)