Remove some redundant explicit NULL checks for pointers before ´delete´ or ´delete[]´ calls since this check is done implicitly when deleting.

Also fixes a memory leak in .reload creature_template command

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-06-21 23:20:58 +02:00
parent 5c86cc2aee
commit 95ddfbd9e2
19 changed files with 47 additions and 94 deletions
@@ -117,11 +117,8 @@ bool Bag::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result)
for (uint8 i = 0; i < MAX_BAG_SIZE; ++i)
{
SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (i*2), 0);
if (m_bagslot[i])
{
delete m_bagslot[i];
m_bagslot[i] = NULL;
}
delete m_bagslot[i];
m_bagslot[i] = NULL;
}
return true;