aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-15 22:28:45 +0000
committerGravatar Sadie Powell2023-01-15 22:28:45 +0000
commit769f9c0c340635cf401bdc92cb9a4c515ffeb0f3 (patch)
treee4bfe0849a5f47acdc1fce4b685209696641e48a /src/modules
parentFix cloaking users with a non-IP hostname when using hmac-sha256-ip. (diff)
Fix some issues reported by scan-build.
All of these are harmless and should never cause an issue in practise.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_blockamsg.cpp3
-rw-r--r--src/modules/m_cloak.cpp2
-rw-r--r--src/modules/m_dccallow.cpp7
-rw-r--r--src/modules/m_silence.cpp7
4 files changed, 16 insertions, 3 deletions
diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp
index 3a69a4724..f3cbfd37a 100644
--- a/src/modules/m_blockamsg.cpp
+++ b/src/modules/m_blockamsg.cpp
@@ -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;
diff --git a/src/modules/m_cloak.cpp b/src/modules/m_cloak.cpp
index 69907498d..50bb95ec4 100644
--- a/src/modules/m_cloak.cpp
+++ b/src/modules/m_cloak.cpp
@@ -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);
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index bb0a6d2e2..67e28c93b 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -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);
}
diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp
index dd2f764b5..3d53f00e3 100644
--- a/src/modules/m_silence.cpp
+++ b/src/modules/m_silence.cpp
@@ -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);
}