mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Possibly fixed more memory leaks in other places.
--HG-- branch : trunk
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user