Core/Misc: Fix static analysis issues

Fix some static analysis issues reported by Coverity
This commit is contained in:
jackpoz
2015-01-20 22:55:06 +01:00
parent 0ceb8003ee
commit 0edc35b921
5 changed files with 15 additions and 8 deletions

View File

@@ -12180,6 +12180,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
uint32 Id = i->aura->GetId();
AuraApplication* aurApp = i->aura->GetApplicationOfTarget(GetGUID());
ASSERT(aurApp);
bool prepare = i->aura->CallScriptPrepareProcHandlers(aurApp, eventInfo);

View File

@@ -229,7 +229,7 @@ namespace WorldPackets
void Read() override;
int32 DifficultyID;
int32 DifficultyID = 0;
};
class SetRaidDifficulty final : public ClientPacket
@@ -239,8 +239,8 @@ namespace WorldPackets
void Read() override;
int32 DifficultyID;
uint8 Legacy;
int32 DifficultyID = 0;
uint8 Legacy = 0;
};
class DungeonDifficultySet final : public ServerPacket
@@ -250,7 +250,7 @@ namespace WorldPackets
WorldPacket const* Write() override;
int32 DifficultyID;
int32 DifficultyID = 0;
};
class RaidDifficultySet final : public ServerPacket
@@ -260,8 +260,8 @@ namespace WorldPackets
WorldPacket const* Write() override;
int32 DifficultyID;
uint8 Legacy;
int32 DifficultyID = 0;
uint8 Legacy = 0;
};
class CorpseReclaimDelay : public ServerPacket

View File

@@ -545,7 +545,11 @@ char* DB2DatabaseLoader::Load(const char* format, int32 preparedStatement, uint3
} while (result->NextRow());
if (!newRecords)
{
delete[] tempDataTable;
delete[] newIndexes;
return nullptr;
}
// Compact new data table to only contain new records not previously loaded from file
char* dataTable = new char[newRecords * recordSize];

View File

@@ -21,7 +21,8 @@
#include "dbcfile.h"
DBCFile::DBCFile(HANDLE file) :
_file(file), _data(NULL), _stringTable(NULL)
_file(file), _recordSize(0), _recordCount(0), _fieldCount(0),
_stringSize(0), _data(NULL), _stringTable(NULL)
{
}

View File

@@ -21,7 +21,8 @@
#include "dbcfile.h"
DBCFile::DBCFile(HANDLE mpq, const char* filename) :
_mpq(mpq), _filename(filename), _file(NULL), _data(NULL), _stringTable(NULL)
_mpq(mpq), _filename(filename), _file(NULL), _recordSize(0), _recordCount(0),
_fieldCount(0), _stringSize(0), _data(NULL), _stringTable(NULL)
{
}