mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Fix some issues reported by scan-build.
All of these are harmless and should never cause an issue in practise.
This commit is contained in:
parent
9109587ed2
commit
769f9c0c34
@ -279,21 +279,27 @@ found_src:
|
||||
// The modules registered for a hook are called in reverse order (to allow for easier removal
|
||||
// of list entries while looping), meaning that the Priority given to us has the exact opposite effect
|
||||
// on the list, e.g.: PRIORITY_BEFORE will actually put 'mod' after 'which', etc.
|
||||
size_t swap_pos = my_pos;
|
||||
size_t swap_pos;
|
||||
switch (s)
|
||||
{
|
||||
case PRIORITY_LAST:
|
||||
{
|
||||
if (prioritizationState != PRIO_STATE_FIRST)
|
||||
return true;
|
||||
else
|
||||
swap_pos = 0;
|
||||
|
||||
swap_pos = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case PRIORITY_FIRST:
|
||||
{
|
||||
if (prioritizationState != PRIO_STATE_FIRST)
|
||||
return true;
|
||||
else
|
||||
swap_pos = EventHandlers[i].size() - 1;
|
||||
|
||||
swap_pos = EventHandlers[i].size() - 1;
|
||||
break;
|
||||
}
|
||||
|
||||
case PRIORITY_BEFORE:
|
||||
{
|
||||
/* Find the latest possible position, only searching AFTER our position */
|
||||
@ -308,6 +314,7 @@ found_src:
|
||||
// didn't find it - either not loaded or we're already after
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Place this module before a set of other modules */
|
||||
case PRIORITY_AFTER:
|
||||
{
|
||||
@ -322,6 +329,9 @@ found_src:
|
||||
// didn't find it - either not loaded or we're already before
|
||||
return true;
|
||||
}
|
||||
|
||||
default:
|
||||
return true; // Should never happen.
|
||||
}
|
||||
|
||||
swap_now:
|
||||
|
@ -143,8 +143,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
m = new BlockedMessage(parameters[1], parameters[0], ServerInstance->Time());
|
||||
blockamsg.Set(user, m);
|
||||
blockamsg.SetFwd(user, parameters[1], parameters[0], ServerInstance->Time());
|
||||
}
|
||||
}
|
||||
return MOD_RES_PASSTHRU;
|
||||
|
@ -138,7 +138,7 @@ public:
|
||||
cloaks->push_back(cloak);
|
||||
|
||||
ServerInstance->Logs.Debug(MODNAME, "Cloaked %s (%s/%s) as %s using the %s method.",
|
||||
user->uuid.c_str(), user->GetIPString().c_str(), user->GetRealHost().c_str(),
|
||||
user->uuid.c_str(), user->GetIPString().c_str(), user->GetRealHost().c_str(),
|
||||
cloak.c_str(), cloakmethod->GetName());
|
||||
}
|
||||
ext.Set(user, cloaks);
|
||||
|
@ -160,6 +160,13 @@ public:
|
||||
list->push_back(dccallow);
|
||||
}
|
||||
|
||||
// If we have an empty list then don't store it.
|
||||
if (list->empty())
|
||||
{
|
||||
delete list;
|
||||
return;
|
||||
}
|
||||
|
||||
// The value was well formed.
|
||||
Set(user, list);
|
||||
}
|
||||
|
@ -247,6 +247,13 @@ public:
|
||||
list->emplace(flags, mask);
|
||||
}
|
||||
|
||||
// If we have an empty list then don't store it.
|
||||
if (list->empty())
|
||||
{
|
||||
delete list;
|
||||
return;
|
||||
}
|
||||
|
||||
// The value was well formed.
|
||||
Set(user, list);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user