aboutsummaryrefslogtreecommitdiff
path: root/modules/dccallow.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-30 00:20:04 +0100
committerGravatar Sadie Powell2026-03-30 00:38:26 +0100
commit5829bfcf7598d66117507702bcdc8d7875f48753 (patch)
tree656e5d7a271d80139dde5ed1d3d0687a4a819e55 /modules/dccallow.cpp
parentCall the correct creation method in the silence module. (diff)
Switch dccallow to ValuePtr and Create.
Diffstat (limited to 'modules/dccallow.cpp')
-rw-r--r--modules/dccallow.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/dccallow.cpp b/modules/dccallow.cpp
index d7dcc372d..02c04559b 100644
--- a/modules/dccallow.cpp
+++ b/modules/dccallow.cpp
@@ -130,17 +130,16 @@ public:
// Remove the old list and create a new one.
Unset(user, false);
- dccallowlist* list = nullptr;
+ ValuePtr list;
StringSplitter ts(value);
while (!ts.AtEnd())
{
// Check we have space for another entry.
- if (list->size() >= maxentries)
+ if (list && list->size() >= maxentries)
{
ServerInstance->Logs.Debug(MODNAME, "Oversized DCC allow list received for {}: {}",
user->uuid, value);
- delete list;
return;
}
@@ -153,13 +152,12 @@ public:
{
ServerInstance->Logs.Debug(MODNAME, "Malformed DCC allow list received for {}: {}",
user->uuid, value);
- delete list;
return;
}
// Store the DCC allow entry.
if (!list)
- list = new dccallowlist();
+ list = Create();
list->push_back(dccallow);
}