Possibly fixed more memory leaks in other places.

--HG--
branch : trunk
This commit is contained in:
raczman
2009-05-13 14:06:33 +02:00
parent 5748c36621
commit bfaaa8201e
6 changed files with 20 additions and 3 deletions

View File

@@ -3827,6 +3827,9 @@ bool ChatHandler::HandleCreatePetCommand(const char* args)
// Everything looks OK, create new pet
Pet* pet = new Pet(HUNTER_PET);
if(!pet)
return false;
if(!pet->CreateBaseAtCreature(creatureTarget))
{
delete pet;
@@ -3846,6 +3849,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* args)
{
sLog.outError("ERROR: InitStatsForLevel() in EffectTameCreature failed! Pet deleted.");
PSendSysMessage("Error 2");
delete pet;
return false;
}