From 081153b99a9af8f7da1085db8de59ee2b3c2151f Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 4 Jul 2013 17:04:38 +0200 Subject: bugfix: very small memory leak in imrelp more or less cosmetic, a single memory block was not freed, but this only happens immediately before termination (when the OS automatically frees all memory). Still an annoyance e.g. in valgrind. --- plugins/imrelp/imrelp.c | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins/imrelp/imrelp.c') diff --git a/plugins/imrelp/imrelp.c b/plugins/imrelp/imrelp.c index 74cfeb72..41d96fe1 100644 --- a/plugins/imrelp/imrelp.c +++ b/plugins/imrelp/imrelp.c @@ -516,6 +516,7 @@ CODESTARTfreeCnf inst = inst->next; free(del); } + free(pModConf->pszBindRuleset); ENDfreeCnf /* This is used to terminate the plugin. Note that the signal handler blocks -- cgit v1.2.3 From 39aa8eb08a1b4c297dabf829690b6fcc05707c21 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 5 Jul 2013 09:22:58 +0200 Subject: make use of new librelp generic error reporting facility This leads to more error messages being passed to the user and thus simplified troubleshooting. librelp 1.2.0 is now required --- plugins/imrelp/imrelp.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins/imrelp/imrelp.c') diff --git a/plugins/imrelp/imrelp.c b/plugins/imrelp/imrelp.c index 41d96fe1..d04e41e1 100644 --- a/plugins/imrelp/imrelp.c +++ b/plugins/imrelp/imrelp.c @@ -156,6 +156,13 @@ onErr(void *pUsr, char *objinfo, char* errmesg, __attribute__((unused)) relpRetV inst->pszBindPort, errmesg, objinfo); } +static void +onGenericErr(char *objinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) +{ + errmsg.LogError(0, RS_RET_RELP_ERR, "imrelp: librelp error '%s', object " + " '%s' - input may not work as intended", errmesg, objinfo); +} + static void onAuthErr(void *pUsr, char *authinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) { @@ -288,6 +295,7 @@ addListner(modConfData_t __attribute__((unused)) *modConf, instanceConf_t *inst) CHKiRet(relpEngineSetEnableCmd(pRelpEngine, (uchar*) "syslog", eRelpCmdState_Required)); CHKiRet(relpEngineSetSyslogRcv2(pRelpEngine, onSyslogRcv)); CHKiRet(relpEngineSetOnErr(pRelpEngine, onErr)); + CHKiRet(relpEngineSetOnGenericErr(pRelpEngine, onGenericErr)); CHKiRet(relpEngineSetOnAuthErr(pRelpEngine, onAuthErr)); if (!glbl.GetDisableDNS()) { CHKiRet(relpEngineSetDnsLookupMode(pRelpEngine, 1)); -- cgit v1.2.3