summaryrefslogtreecommitdiff
path: root/src/core/cs_set.c
diff options
context:
space:
mode:
authormokkori <brezelzombie@live.de>2013-02-17 16:08:51 +0100
committerAdam <Adam@anope.org>2013-07-25 19:42:18 -0400
commitd2d89ac412dbdba0747e44cdf1e4c90e29f6ef2b (patch)
tree26a48c6e90a6eb02ba6326864c87879b810d00f2 /src/core/cs_set.c
parente090eaea65efdac33539d80317a9370c04681301 (diff)
Memory: Properly initialize and free new module languages.
Memory: Properly free strings in module config directive lookups. Memory: Do not leak module version and author in rare situations. Memory: Memory leak when deleting a module callback. Memory: Memory leaks with module messages. Memory: Memory leaks with module commands. Memory: Memory leaks with module event handlers. Memory: Memory leaks with module event hooks. Memory: Every module config entry of type string is leaked on config reload. Memory: Leak services root list, ulines list, host setters list, modules autoload list, modules delayed autoload list, hostserv/memoserv/helpserv/botserv/operserv/chanserv/nickserv core modules lists on config reload. Memory: Leaks with channel bans/invites/exceptions. Memory: Leak when updating already existing ignore. Memory: Invalid pointer read in slists. Memory: Leak when using /cs appendtopic. Memory: Leak on (currently impossible) config reload. Memory: Syscall param write(buf) points to uninitialised byte(s) in save_ns_dbase(). Memory: Leak if PreNickServDB is set and NSEmailReg is not. Removing a command no longer calls free() on help_param*, reversed previous changes Changes to CSMaxReg, MSMaxMemos and NewsCount are now properly reflected in help notices after config reload Small adjustments Fixed copy&paste mistake Fix findCommand() searching in the wrong command tables
Diffstat (limited to 'src/core/cs_set.c')
-rw-r--r--src/core/cs_set.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/core/cs_set.c b/src/core/cs_set.c
index 7138a2054..f82a74c78 100644
--- a/src/core/cs_set.c
+++ b/src/core/cs_set.c
@@ -37,6 +37,7 @@ static int do_set_opnotice(User * u, ChannelInfo * ci, char *param);
static int do_set_xop(User * u, ChannelInfo * ci, char *param);
static int do_set_peace(User * u, ChannelInfo * ci, char *param);
static int do_set_noexpire(User * u, ChannelInfo * ci, char *param);
+static int reload_config(int argc, char **argv);
static void myChanServHelp(User * u);
/**
@@ -48,6 +49,7 @@ static void myChanServHelp(User * u);
int AnopeInit(int argc, char **argv)
{
Command *c;
+ EvtHook *hook;
moduleAddAuthor("Anope");
moduleAddVersion(VERSION_STRING);
@@ -125,6 +127,12 @@ int AnopeInit(int argc, char **argv)
moduleSetChanHelp(myChanServHelp);
+ hook = createEventHook(EVENT_RELOAD, reload_config);
+ if (moduleAddEventHook(hook) != MOD_ERR_OK) {
+ alog("[\002cs_set\002] Can't hook to EVENT_RELOAD event");
+ return MOD_STOP;
+ }
+
return MOD_CONT;
}
@@ -898,3 +906,18 @@ static int do_set_noexpire(User * u, ChannelInfo * ci, char *param)
}
return MOD_CONT;
}
+
+/*************************************************************************/
+
+/**
+ * Upon /os reload refresh the limit in help output
+ **/
+static int reload_config(int argc, char **argv) {
+ Command *c;
+
+ if (argc >= 1 && !stricmp(argv[0], EVENT_START))
+ if ((c = findCommand(CHANSERV, "SET SUCCESSOR")))
+ c->help_param1 = (char *) (long) CSMaxReg;
+
+ return MOD_CONT;
+}