diff options
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)) { |