diff options
-rw-r--r-- | src/game/BattleGround.cpp | 1 | ||||
-rw-r--r-- | src/game/Chat.cpp | 1 | ||||
-rw-r--r-- | src/game/Level2.cpp | 4 | ||||
-rw-r--r-- | src/game/ObjectMgr.cpp | 6 | ||||
-rw-r--r-- | src/game/OutdoorPvP.cpp | 2 | ||||
-rw-r--r-- | src/game/OutdoorPvPSI.cpp | 9 |
6 files changed, 20 insertions, 3 deletions
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index 6c8185b97d2..9be5650a16e 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -1323,6 +1323,7 @@ Creature* BattleGround::AddCreature(uint32 entry, uint32 type, uint32 teamval, f if(!pCreature->IsPositionValid()) { sLog.outError("ERROR: Creature (guidlow %d, entry %d) not added to battleground. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY()); + delete pCreature; return NULL; } diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 15206f10c29..5d0901b0596 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -766,6 +766,7 @@ void ChatHandler::SendGlobalGMSysMessage(const char *str) FillSystemMessageData(&data, line); sWorld.SendGlobalGMMessage(&data); } + delete buf; } void ChatHandler::SendSysMessage(int32 entry) diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 4937d230142..fc6e8a51a74 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -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; } diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index c948ad9d073..227b0f90f28 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -4124,7 +4124,11 @@ void ObjectMgr::LoadGossipText() pGText->Options[i].Emotes[2]._Emote = fields[cic++].GetUInt32(); } - if ( !pGText->Text_ID ) continue; + if ( !pGText->Text_ID ){ + delete pGText; + continue; + } + AddGossipText( pGText ); } while( result->NextRow() ); diff --git a/src/game/OutdoorPvP.cpp b/src/game/OutdoorPvP.cpp index 99b1c9a55f0..17f08131197 100644 --- a/src/game/OutdoorPvP.cpp +++ b/src/game/OutdoorPvP.cpp @@ -170,6 +170,7 @@ bool OutdoorPvPObjective::AddCreature(uint32 type, uint32 entry, uint32 teamval, if(!pCreature->IsPositionValid()) { sLog.outError("ERROR: Creature (guidlow %d, entry %d) not added to opvp. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY()); + delete pCreature; return false; } @@ -283,6 +284,7 @@ bool OutdoorPvPObjective::AddCapturePoint(uint32 entry, uint32 map, float x, flo if(!pCreature->IsPositionValid()) { sLog.outError("ERROR: Creature (guidlow %d, entry %d) not added to opvp. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY()); + delete pCreature; return false; } diff --git a/src/game/OutdoorPvPSI.cpp b/src/game/OutdoorPvPSI.cpp index 378543da48e..e4686573a67 100644 --- a/src/game/OutdoorPvPSI.cpp +++ b/src/game/OutdoorPvPSI.cpp @@ -200,8 +200,13 @@ bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId) // he dropped it further, summon mound GameObject * go = new GameObject; Map * map = MapManager::Instance().GetMap(plr->GetMapId(), plr); - if(!map) - return true; + if(!map){ + + delete go; + return true; + + } + if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1)) { delete go; |