diff options
author | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-12-30 15:00:22 +0000 |
---|---|---|
committer | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-12-30 15:00:22 +0000 |
commit | ae0f3c487d748a59cecde5a1fec8d67d3032a37f (patch) | |
tree | f1a2e19b21ff06baa5955b8bd5a9f9913188bb1a /src/modules.c | |
parent | 2be671378524ee8feebb22ec218e8dd2e37418eb (diff) |
BUILD : 1.7.6 (513) BUGS : NOTES : Added warnings for NULL-args with sstrdup, and NULL modname with module*Data functions. Fixed Catserv to use moduleAddCommand instead of addCommand.
git-svn-id: svn://svn.anope.org/anope/trunk@513 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@367 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modules.c')
-rw-r--r-- | src/modules.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/modules.c b/src/modules.c index 20dc37664..83913870f 100644 --- a/src/modules.c +++ b/src/modules.c @@ -1823,6 +1823,12 @@ int moduleAddData(ModuleData ** md, char *key, char *value) alog("A module tried to use ModuleAddData() with one ore more NULL arguments... returning"); return MOD_ERR_PARAMS; } + + if (mod_current_module_name == NULL) { + alog("moduleAddData() called with mod_current_module_name being NULL"); + if (debug) + do_backtrace(0); + } moduleDelData(md, key); /* Remove any existing module data for this module with the same key */ @@ -1862,6 +1868,12 @@ char *moduleGetData(ModuleData ** md, char *key) char *mod_name = sstrdup(mod_current_module_name); ModuleData *current = *md; + if (mod_current_module_name == NULL) { + alog("moduleGetData() called with mod_current_module_name being NULL"); + if (debug) + do_backtrace(0); + } + if (debug) { alog("debug: moduleGetData %p : key %s", (void *) md, key); alog("debug: Current Module %s", mod_name); @@ -1891,6 +1903,12 @@ void moduleDelData(ModuleData ** md, char *key) ModuleData *prev = NULL; ModuleData *next = NULL; + if (mod_current_module_name == NULL) { + alog("moduleDelData() called with mod_current_module_name being NULL"); + if (debug) + do_backtrace(0); + } + if (key) { while (current) { next = current->next; @@ -1927,6 +1945,12 @@ void moduleDelAllData(ModuleData ** md) ModuleData *prev = NULL; ModuleData *next = NULL; + if (mod_current_module_name == NULL) { + alog("moduleDelAllData() called with mod_current_module_name being NULL"); + if (debug) + do_backtrace(0); + } + while (current) { next = current->next; if ((stricmp(current->moduleName, mod_name) == 0)) { |