mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 19:19:02 -04:00
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:
parent
ff407e6751
commit
0680b52987
@ -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];
|
||||
|
@ -550,6 +550,8 @@ void ModuleManager::LoadAll()
|
||||
}
|
||||
}
|
||||
|
||||
this->NewServices = NULL;
|
||||
|
||||
if (!PrioritizeHooks())
|
||||
ServerInstance->Exit(EXIT_STATUS_MODULE);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user