From 5829bfcf7598d66117507702bcdc8d7875f48753 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 30 Mar 2026 00:20:04 +0100 Subject: Switch dccallow to ValuePtr and Create. --- modules/dccallow.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'modules/dccallow.cpp') 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); } -- cgit v1.3.1-10-gc9f91