Fix issues discovered by Coverity

- Fix resource leak in InspIRCd::Format()
- Explicitly set NewServices to NULL before the object it points to goes out of scope
This commit is contained in:
Daniel Vassdal 2013-11-24 16:04:32 -08:00 committed by Attila Molnar
parent ff407e6751
commit 0680b52987
2 changed files with 4 additions and 0 deletions

View File

@ -400,6 +400,8 @@ const char* InspIRCd::Format(va_list &vaList, const char* formatString)
va_copy(dst, vaList);
int vsnret = vsnprintf(&formatBuffer[0], formatBuffer.size(), formatString, dst);
va_end(dst);
if (vsnret > 0 && static_cast<unsigned>(vsnret) < formatBuffer.size())
{
return &formatBuffer[0];

View File

@ -550,6 +550,8 @@ void ModuleManager::LoadAll()
}
}
this->NewServices = NULL;
if (!PrioritizeHooks())
ServerInstance->Exit(EXIT_STATUS_MODULE);
}