summaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-03 08:47:35 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-03 08:47:35 +0000
commit11461ad9c6de62556df79a35ff0c4902e2881f57 (patch)
treebcebd3205f213ddd4a9ae5218d40bbe0f16b965f /conf.c
parent2be9977a4db263400c8ba56c82e576b7da42cd86 (diff)
downloadrsyslog-11461ad9c6de62556df79a35ff0c4902e2881f57.tar.gz
rsyslog-11461ad9c6de62556df79a35ff0c4902e2881f57.tar.xz
rsyslog-11461ad9c6de62556df79a35ff0c4902e2881f57.zip
bugfix: memory leaks in script engine
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/conf.c b/conf.c
index 14e73f0e..f87ab992 100644
--- a/conf.c
+++ b/conf.c
@@ -68,6 +68,7 @@ static rsRetVal processConfFile(uchar *pConfFile);
DEFobjStaticHelpers
DEFobjCurrIf(expr)
DEFobjCurrIf(ctok)
+DEFobjCurrIf(ctok_token)
DEFobjCurrIf(module)
DEFobjCurrIf(errmsg)
DEFobjCurrIf(net)
@@ -762,9 +763,12 @@ dbgprintf("calling expression parser, pp %p ('%s')\n", *pline, *pline);
*/
CHKiRet(ctok.GetToken(tok, &pToken));
if(pToken->tok != ctok_THEN) {
+ ctok_token.Destruct(&pToken);
ABORT_FINALIZE(RS_RET_SYNTAX_ERROR);
}
+ ctok_token.Destruct(&pToken); /* no longer needed */
+
/* we are done, so we now need to restore things */
CHKiRet(ctok.Getpp(tok, pline));
CHKiRet(ctok.Destruct(&tok));
@@ -1183,6 +1187,7 @@ CODESTARTObjClassExit(conf)
/* release objects we no longer need */
objRelease(expr, CORE_COMPONENT);
objRelease(ctok, CORE_COMPONENT);
+ objRelease(ctok_token, CORE_COMPONENT);
objRelease(module, CORE_COMPONENT);
objRelease(errmsg, CORE_COMPONENT);
objRelease(net, LM_NET_FILENAME);
@@ -1197,6 +1202,7 @@ BEGINAbstractObjClassInit(conf, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANG
/* request objects we use */
CHKiRet(objUse(expr, CORE_COMPONENT));
CHKiRet(objUse(ctok, CORE_COMPONENT));
+ CHKiRet(objUse(ctok_token, CORE_COMPONENT));
CHKiRet(objUse(module, CORE_COMPONENT));
CHKiRet(objUse(errmsg, CORE_COMPONENT));
CHKiRet(objUse(net, LM_NET_FILENAME)); /* TODO: make this dependcy go away! */