Core/Misc: Fix issues reported by static analysis

Coverity defect IDs: 1292760, 1292761, 1292762, 1292771, 1292770
This commit is contained in:
jackpoz committed 2015-04-04 12:44:56 +02:00
1 parent 1a2c20f95d
commit 25e86f75f8
4 files changed
+5 -12

No files matched your search

@@ -2213,12 +2213,7 @@ void Creature::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs
continue;
uint32 unSpellId = m_spells[i];
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
if (!spellInfo)
{
ASSERT(spellInfo);
continue;
}
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(unSpellId);
// Not send cooldown for this spells
if (spellInfo->IsCooldownStartedOnEvent())
+1 -6
View File
@@ -21532,12 +21532,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
if (itr->second->state == PLAYERSPELL_REMOVED)
continue;
uint32 unSpellId = itr->first;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
if (!spellInfo)
{
ASSERT(spellInfo);
continue;
}
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(unSpellId);
// Not send cooldown for this spells
if (spellInfo->IsCooldownStartedOnEvent())
+2
View File
@@ -184,6 +184,7 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY)
ModelInstance inst(ADT,ModelInstansName[id].c_str(), map_num, tileX, tileY, dirfile);
}
delete[] ModelInstansName;
ModelInstansName = NULL;
}
}
else if (!strcmp(fourcc,"MODF"))
@@ -198,6 +199,7 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY)
WMOInstance inst(ADT,WmoInstansName[id].c_str(), map_num, tileX, tileY, dirfile);
}
delete[] WmoInstansName;
WmoInstansName = NULL;
}
}
//======================
+1
View File
@@ -103,6 +103,7 @@ bool WDTFile::init(char* /*map_id*/, unsigned int mapID)
}
delete[] gWmoInstansName;
gWmoInstansName = NULL;
}
}
WDT.seek((int)nextpos);