From d2d89ac412dbdba0747e44cdf1e4c90e29f6ef2b Mon Sep 17 00:00:00 2001 From: mokkori Date: Sun, 17 Feb 2013 16:08:51 +0100 Subject: 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 --- src/modules/hs_request.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/modules/hs_request.c') diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c index 47c3de46f..36f3b013d 100644 --- a/src/modules/hs_request.c +++ b/src/modules/hs_request.c @@ -719,13 +719,12 @@ static void my_load_config(void) for (i = 0; i < 4; i++) moduleGetConfigDirective(confvalues[i]); - if (tmp) { - if (HSRequestDBName) - free(HSRequestDBName); + Anope_Free(HSRequestDBName); + + if (tmp) HSRequestDBName = sstrdup(tmp); - } else { + else HSRequestDBName = sstrdup(HSREQ_DEFAULT_DBNAME); - } if (debug) alog("debug: [hs_request] Set config vars: MemoUser=%d MemoOper=%d MemoSetters=%d DBName='%s'", HSRequestMemoUser, HSRequestMemoOper, HSRequestMemoSetters, HSRequestDBName); -- cgit