Few minor issues highlighted by cppcheck/valgrind.

This commit is contained in:
Derision 2013-03-04 19:15:07 +00:00
parent af1f87a00f
commit c8ca362eba
5 changed files with 7 additions and 7 deletions

View File

@ -80,7 +80,7 @@ HttpdForm::HttpdForm(IFile *infil) : raw(false)
std::string content_type; std::string content_type;
std::string current_name; std::string current_name;
std::string current_filename; std::string current_filename;
char slask[200]; char slask[2000];
infil -> fgets(slask, 200); infil -> fgets(slask, 200);
while (!infil -> eof()) while (!infil -> eof())
{ {

View File

@ -140,8 +140,8 @@ RegularOpcodeManager::RegularOpcodeManager()
} }
RegularOpcodeManager::~RegularOpcodeManager() { RegularOpcodeManager::~RegularOpcodeManager() {
safe_delete(emu_to_eq); safe_delete_array(emu_to_eq);
safe_delete(eq_to_emu); safe_delete_array(eq_to_emu);
} }
bool RegularOpcodeManager::LoadOpcodes(const char *filename, bool report_errors) { bool RegularOpcodeManager::LoadOpcodes(const char *filename, bool report_errors) {

View File

@ -11629,5 +11629,5 @@ void command_augmentitem(Client *c, const Seperator *sep)
in_augment->augment_slot = -1; in_augment->augment_slot = -1;
if(c->GetTradeskillObject() != NULL) if(c->GetTradeskillObject() != NULL)
Object::HandleAugmentation(c, in_augment, c->GetTradeskillObject()); Object::HandleAugmentation(c, in_augment, c->GetTradeskillObject());
safe_delete(in_augment); safe_delete_array(in_augment);
} }

View File

@ -5450,7 +5450,7 @@ void NPC::LoadMercTypes(){
mysql_free_result(DatasetResult); mysql_free_result(DatasetResult);
} }
safe_delete(Query); safe_delete_array(Query);
Query = 0; Query = 0;
if(!errorMessage.empty()) { if(!errorMessage.empty()) {
@ -5486,7 +5486,7 @@ void NPC::LoadMercs(){
mysql_free_result(DatasetResult); mysql_free_result(DatasetResult);
} }
safe_delete(Query); safe_delete_array(Query);
Query = 0; Query = 0;
if(!errorMessage.empty()) { if(!errorMessage.empty()) {

View File

@ -1094,7 +1094,7 @@ int Parser::LoadScript(int npcid, const char * zone, Mob* activater)
buffer.replace(buffer.length()-1,buffer.length(),""); buffer.replace(buffer.length()-1,buffer.length(),"");
int heh = ParseCommands(buffer,line_num,0,0,0,0,filename); int heh = ParseCommands(buffer,line_num,0,0,0,0,filename);
if (!heh){ if (!heh){
safe_delete_array(NewEventList); safe_delete(NewEventList);
return 0; return 0;
} }
event1->command = buffer; event1->command = buffer;