fix some cppcheck detected (potential) issues

This commit is contained in:
DarthArgus
2016-02-03 02:00:56 -06:00
parent 095ef804c4
commit adf7f67682
3 changed files with 4 additions and 3 deletions
@@ -123,6 +123,7 @@ void ReportManager::addReport(Unicode::String const &reportingName, NetworkId co
if (((systemTime - iterReportThrottle->second) >= s_throttleTime))
{
s_reportThrottle.erase(iterReportThrottle);
break;
}
}
}
@@ -1637,9 +1637,9 @@ Crafting::CraftingError PlayerObject::fillSlot(int slotIndex, int slotOptionInde
}
slotOptionIndex = i;
if (slotOption->ingredients.size() != 1)
if (slotOption == NULL || slotOption->ingredients.size() != 1)
{
WARNING(true, ("Ingredient %d for draft schematic %s, slot %s, has ingredient count != 1",
WARNING(true, ("slotOption is NULL or ingredient %d for draft schematic %s, slot %s, has ingredient count != 1",
slotOptionIndex, m_draftSchematic->getTemplateName(), draftSlot.name.getText().c_str()));
return Crafting::CE_invalidIngredientSize;
}
@@ -158,7 +158,7 @@ CSAssistGameAPIcore::CSAssistGameAPIcore(CSAssistGameAPI *api, const char *serve
//fprintf(stderr, "res=%d, p=%s, host=%s, port=%d, size=%d\n", res, p, host, port, m_serverList.size());
delete [] p;
}
delete host;
delete [] host;
delete [] buf;
m_curServer = m_serverList.begin();
GetLBHost();