summaryrefslogtreecommitdiffstats
path: root/runtime/modules.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-06-25 12:35:46 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-06-25 12:35:46 +0200
commitbf85d81790a26945e404c6fdfdddad5eadbaa371 (patch)
tree5b9e97ea2c78e9450f58971ecae3234ba7eb3c85 /runtime/modules.c
parent4b150db338ae885ea3a3bb7cc5b5f84e2fc96e89 (diff)
downloadrsyslog-bf85d81790a26945e404c6fdfdddad5eadbaa371.tar.gz
rsyslog-bf85d81790a26945e404c6fdfdddad5eadbaa371.tar.xz
rsyslog-bf85d81790a26945e404c6fdfdddad5eadbaa371.zip
implemented freeCnf() module interface & fixed some mem leaks
The interface was actually not present in older versions, even though some modules already used it. The implementation was now done, and not in 6.3/6.4 because the resulting memory leak was ultra-slim and the new interface handling has some potential to seriously break things. Not the kind of thing you want to add in late beta state, if avoidable.
Diffstat (limited to 'runtime/modules.c')
-rw-r--r--runtime/modules.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/runtime/modules.c b/runtime/modules.c
index e7ae72cc..6417cecd 100644
--- a/runtime/modules.c
+++ b/runtime/modules.c
@@ -1001,11 +1001,19 @@ Load(uchar *pModName, sbool bConfLoad, struct nvlst *lst)
localRet = addModToCnfList(pModInfo);
if(pModInfo->setModCnf != NULL && localRet == RS_RET_OK) {
if(!strncmp((char*)pModName, "builtin:", sizeof("builtin:")-1)) {
- /* for built-in moules, we need to call setModConf,
- * because there is no way to set parameters at load
- * time for obvious reasons...
- */
- pModInfo->setModCnf(lst);
+ if(pModInfo->bSetModCnfCalled) {
+ errmsg.LogError(0, RS_RET_DUP_PARAM,
+ "parameters for built-in module %s already set - ignored\n",
+ pModName);
+ ABORT_FINALIZE(RS_RET_DUP_PARAM);
+ } else {
+ /* for built-in moules, we need to call setModConf,
+ * because there is no way to set parameters at load
+ * time for obvious reasons...
+ */
+ pModInfo->setModCnf(lst);
+ pModInfo->bSetModCnfCalled = 1;
+ }
}
}
}
@@ -1119,8 +1127,10 @@ Load(uchar *pModName, sbool bConfLoad, struct nvlst *lst)
if(bConfLoad) {
addModToCnfList(pModInfo);
- if(pModInfo->setModCnf != NULL)
+ if(pModInfo->setModCnf != NULL) {
pModInfo->setModCnf(lst);
+ pModInfo->bSetModCnfCalled = 1;
+ }
}
finalize_it: